MCPcopy Index your code
hub / github.com/rilldata/rill / createFile

Function createFile

cli/pkg/cmdutil/helper_test.go:209–222  ·  view source on GitHub ↗

Helper functions

(t *testing.T, repoPath, fileName, fileContent string)

Source from the content-addressed store, hash-verified

207// Helper functions
208
209func createFile(t *testing.T, repoPath, fileName, fileContent string) {
210 t.Helper()
211 filePath := filepath.Join(repoPath, fileName)
212
213 // Create directory if needed
214 dir := filepath.Dir(filePath)
215 if dir != repoPath {
216 err := os.MkdirAll(dir, 0755)
217 require.NoError(t, err, "failed to create directory")
218 }
219
220 err := os.WriteFile(filePath, []byte(fileContent), 0644)
221 require.NoError(t, err, "failed to create file")
222}
223
224func setupTestRepository(t *testing.T) (string, string) {
225 t.Helper()

Calls 1

MkdirAllMethod · 0.65

Tested by

no test coverage detected