MCPcopy Create free account
hub / github.com/driangle/taskmd / createProjectDir

Function createProjectDir

apps/cli/internal/cli/project_registry_test.go:21–33  ·  view source on GitHub ↗

createProjectDir creates a temp directory with a .taskmd.yaml file inside. Returns the symlink-resolved path for reliable comparisons on macOS.

(t *testing.T)

Source from the content-addressed store, hash-verified

19// createProjectDir creates a temp directory with a .taskmd.yaml file inside.
20// Returns the symlink-resolved path for reliable comparisons on macOS.
21func createProjectDir(t *testing.T) string {
22 t.Helper()
23 dir := t.TempDir()
24 // Resolve symlinks (e.g. /var -> /private/var on macOS)
25 resolved, err := filepath.EvalSymlinks(dir)
26 if err != nil {
27 t.Fatalf("failed to resolve symlinks: %v", err)
28 }
29 if err := os.WriteFile(filepath.Join(resolved, configFilename), []byte("dir: .\n"), 0644); err != nil {
30 t.Fatalf("failed to create %s: %v", configFilename, err)
31 }
32 return resolved
33}
34
35func TestProjectRegister_CWD(t *testing.T) {
36 resetProjectRegistryFlags()

Calls

no outgoing calls

Tested by

no test coverage detected