added git clean script for better sudo integration

This commit is contained in:
2021-06-30 14:34:24 +02:00
parent 489ebf01a2
commit 4efa17fc9e
2 changed files with 5 additions and 2 deletions

3
git_clean.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
cd "$1" && git clean -xdff

View File

@@ -219,7 +219,7 @@ func increasePkgRel(pkg *BuildPackage) {
}
func gitClean(pkg *BuildPackage) {
cmd := backgroundCmd("sudo", "git clean -xff "+filepath.Dir(pkg.Pkgbuild))
cmd := backgroundCmd("sudo", "git_clean.sh "+filepath.Dir(pkg.Pkgbuild))
res, err := cmd.CombinedOutput()
if err != nil {
log.Warningf("git clean failed with %v:\n%s", err, res)
@@ -587,7 +587,7 @@ func (b *BuildManager) syncWorker() {
log.Debug(string(res))
check(err)
} else if err == nil {
cmd := backgroundCmd("sudo", "git clean -xff "+gitPath)
cmd := backgroundCmd("sudo", "git_clean.sh "+gitPath)
res, err := cmd.CombinedOutput()
log.Debug(string(res))
check(err)