mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +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.
|
||||
if err := install.UpdateGitIgnore(gitignoreDir, "logs"); err != nil {
|
||||
// Always ignore operational directories to avoid committing noise.
|
||||
if err := install.UpdateGitIgnoreBatch(gitignoreDir, []string{"logs", "trash"}); err != nil {
|
||||
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")
|
||||
trashDir := trash.ProjectTrashDir(root)
|
||||
|
||||
// Backward compat: ensure operational dirs are gitignored for projects created before v0.17.3.
|
||||
_ = ensureProjectGitignore(root)
|
||||
|
||||
// --- Phase 1: RESOLVE ---
|
||||
var targets []*uninstallTarget
|
||||
seen := map[string]bool{}
|
||||
|
||||
Reference in New Issue
Block a user