Fixup clean path uninstall

While uninstalling, we weren't checking if we left any empty dir behind.
Now we walk the full path to the file in the artifact, and check each
subdir if it's empty. If it is, we delete it as it is claimed by the
package
This commit is contained in:
Ettore Di Giacinto
2021-04-24 19:21:15 +02:00
parent adcb459fd2
commit a4d77f8f99
2 changed files with 58 additions and 0 deletions

View File

@@ -17,9 +17,18 @@
package helpers
import (
"reflect"
"regexp"
)
func ReverseAny(s interface{}) {
n := reflect.ValueOf(s).Len()
swap := reflect.Swapper(s)
for i, j := 0, n-1; i < j; i, j = i+1, j-1 {
swap(i, j)
}
}
func MapMatchRegex(m *map[string]string, r *regexp.Regexp) bool {
ans := false