Issue #317: Moved change in slash so it always occurs
There are some calls to util.GetRootFromPackage that happen outside
NormalizeName. These cases, for Windows, need to have the path
separator properly converted to match regex, etc.
diff --git a/util/util.go b/util/util.go
index d73001a..5cdc0f4 100644
--- a/util/util.go
+++ b/util/util.go
@@ -35,6 +35,7 @@
// the package github.com/Masterminds/cookoo/io has a root repo
// at github.com/Masterminds/cookoo
func GetRootFromPackage(pkg string) string {
+ pkg = filepath.ToSlash(pkg)
for _, v := range vcsList {
m := v.regex.FindStringSubmatch(pkg)
if m == nil {
@@ -306,7 +307,6 @@
}
}
- name = filepath.ToSlash(name)
root := GetRootFromPackage(name)
extra := strings.TrimPrefix(name, root)
if len(extra) > 0 && extra != "/" {