mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
fix(project): add trash/ to .skillshare/.gitignore
Project mode uninstall moves skills to .skillshare/trash/, but this directory was not gitignored — soft-deleted skills could be accidentally committed. - ensureProjectGitignore now adds both logs/ and trash/ via a single UpdateGitIgnoreBatch call (replaces two separate UpdateGitIgnore calls) - uninstall_project.go calls ensureProjectGitignore for backward compat, patching projects created before this fix on next uninstall run
This commit is contained in:
@@ -501,8 +501,8 @@ func ensureProjectGitignore(root string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always ignore project logs to avoid committing operational noise.
|
// Always ignore operational directories to avoid committing noise.
|
||||||
if err := install.UpdateGitIgnore(gitignoreDir, "logs"); err != nil {
|
if err := install.UpdateGitIgnoreBatch(gitignoreDir, []string{"logs", "trash"}); err != nil {
|
||||||
return fmt.Errorf("failed to update .skillshare/.gitignore: %w", err)
|
return fmt.Errorf("failed to update .skillshare/.gitignore: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ func cmdUninstallProject(args []string, root string) error {
|
|||||||
sourceDir := filepath.Join(root, ".skillshare", "skills")
|
sourceDir := filepath.Join(root, ".skillshare", "skills")
|
||||||
trashDir := trash.ProjectTrashDir(root)
|
trashDir := trash.ProjectTrashDir(root)
|
||||||
|
|
||||||
|
// Backward compat: ensure operational dirs are gitignored for projects created before v0.17.3.
|
||||||
|
_ = ensureProjectGitignore(root)
|
||||||
|
|
||||||
// --- Phase 1: RESOLVE ---
|
// --- Phase 1: RESOLVE ---
|
||||||
var targets []*uninstallTarget
|
var targets []*uninstallTarget
|
||||||
seen := map[string]bool{}
|
seen := map[string]bool{}
|
||||||
|
|||||||
Reference in New Issue
Block a user