MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / createExecutableFileInPath

Function createExecutableFileInPath

mob_test.go:2230–2240  ·  view source on GitHub ↗
(t *testing.T, path, filename, content string)

Source from the content-addressed store, hash-verified

2228}
2229
2230func createExecutableFileInPath(t *testing.T, path, filename, content string) (pathToFile string) {
2231 ensureDirectoryExists(t, path)
2232
2233 pathToFile = path + "/" + filename
2234 contentAsBytes := []byte(content)
2235 err := os.WriteFile(pathToFile, contentAsBytes, 0755)
2236 if err != nil {
2237 failWithFailure(t, "creating file "+filename+" with content "+content, "error")
2238 }
2239 return
2240}
2241
2242func createDirectory(t *testing.T, directory string) (pathToDirectory string) {
2243 return ensureDirectoryExists(t, workingDir+"/"+directory)

Callers 1

TestStartDespiteGitHookFunction · 0.85

Calls 2

ensureDirectoryExistsFunction · 0.85
failWithFailureFunction · 0.70

Tested by

no test coverage detected