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

Function writeInitFile

apps/cli/internal/cli/project_init.go:692–710  ·  view source on GitHub ↗
(targetDir string, f fileToWrite)

Source from the content-addressed store, hash-verified

690}
691
692func writeInitFile(targetDir string, f fileToWrite) (absPath string, skipped bool, err error) {
693 outputPath := filepath.Join(targetDir, f.filename)
694 absPath, err = filepath.Abs(outputPath)
695 if err != nil {
696 absPath = outputPath
697 }
698
699 if !projectInitForce {
700 if _, err := os.Stat(outputPath); err == nil {
701 return absPath, true, nil
702 }
703 }
704
705 if err := os.WriteFile(outputPath, f.content, 0644); err != nil {
706 return absPath, false, fmt.Errorf("failed to write %s: %w", f.filename, err)
707 }
708
709 return absPath, false, nil
710}
711
712// printInitSummary prints the list of created files and next steps.
713func printInitSummary(createdPaths []string) {

Callers 1

writeInitFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected