on main help sign in
chore: update generated `.crush/.gitignore` to not ignore skills
commit1a0b6389f0624d5696235bb6343c7a7837ed8da3 authorAndrey Nering <andreynering@users.noreply.github.com> dateTue 24 Mar 2026, 15:11 (7 months ago) parentcd5c937
4 files changed+23−2
.crush/.gitignore+5 internal/cmd/gitignore/default+5 internal/cmd/gitignore/old+1 internal/cmd/root.go+12−2
.crush/.gitignorenew file+5
@@ -0,0 +1,5 @@
1+# This file is automatically generated by Crush.
2+*
3+!.gitignore
4+!skills/
5+!skills/**
internal/cmd/gitignore/defaultnew file+5
@@ -0,0 +1,5 @@
1+# This file is automatically generated by Crush.
2+*
3+!.gitignore
4+!skills/
5+!skills/**
internal/cmd/gitignore/oldnew file+1
@@ -0,0 +1 @@
1+*
internal/cmd/root.go+12−2
@@ -3,6 +3,7 @@ package cmd
33import (
44 "bytes"
55 "context"
6+ _ "embed"
67 "errors"
78 "fmt"
89 "io"
@@ -305,11 +306,20 @@ func createDotCrushDir(dir string) error {
305306 }
306307
307308 gitIgnorePath := filepath.Join(dir, ".gitignore")
308− if _, err := os.Stat(gitIgnorePath); os.IsNotExist(err) {
309− if err := os.WriteFile(gitIgnorePath, []byte("*\n"), 0o644); err != nil {
309+ content, err := os.ReadFile(gitIgnorePath)
310+
311+ // create or update if old version
312+ if os.IsNotExist(err) || string(content) == oldGitIgnore {
313+ if err := os.WriteFile(gitIgnorePath, []byte(defaultGitIgnore), 0o644); err != nil {
310314 return fmt.Errorf("failed to create .gitignore file: %q %w", gitIgnorePath, err)
311315 }
312316 }
313317
314318 return nil
315319}
320+
321+//go:embed gitignore/old
322+var oldGitIgnore string
323+
324+//go:embed gitignore/default
325+var defaultGitIgnore string