Fix #1279: Error not git repository on yay -Sc
This commit is contained in:
1 parent
acf95aed5b
commit
3549aeca26
1 file changed
+9
-3
@@ -196,14 +196,20 @@ func cleanUntracked() error {
|
||||
}
|
||||
|
||||
dir := filepath.Join(config.BuildDir, file.Name())
|
||||
if err := show(passToGit(dir, "clean", "-fx")); err != nil {
|
||||
return err
|
||||
if isGitRepository(dir) {
|
||||
if err := show(passToGit(dir, "clean", "-fx")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func isGitRepository(dir string) bool {
|
||||
_, err := os.Stat(filepath.Join(dir, ".git"))
|
||||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
func cleanAfter(bases []Base) {
|
||||
fmt.Println(gotext.Get("removing untracked AUR files from cache..."))
|
||||
|
||||
|
||||
Reference in new issue
Block a user