mirror of
https://github.com/Jguer/yay.git
synced 2025-10-15 00:02:26 -04:00
Fix #1279: Error not git repository on yay -Sc
This commit is contained in:
parent
acf95aed5b
commit
3549aeca26
12
clean.go
12
clean.go
@ -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..."))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user