Skip to content

Commit 8342b0d

Browse files
committed
fix(dotfiles): skip git pull when .dotfiles is not a git repository
1 parent 469d6a9 commit 8342b0d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/dotfiles/dotfiles.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func Clone(repoURL string, dryRun bool) error {
2626
dotfilesPath := filepath.Join(home, defaultDotfilesDir)
2727

2828
if _, err := os.Stat(dotfilesPath); err == nil {
29+
gitDir := filepath.Join(dotfilesPath, ".git")
30+
if _, err := os.Stat(gitDir); os.IsNotExist(err) {
31+
fmt.Printf("Dotfiles already exist at %s, skipping clone\n", dotfilesPath)
32+
return nil
33+
}
2934
if dryRun {
3035
fmt.Printf("[DRY-RUN] Would pull latest dotfiles at %s\n", dotfilesPath)
3136
return nil

0 commit comments

Comments
 (0)