Updating messages noting imports files to remove basepath
diff --git a/gb/gb.go b/gb/gb.go index e99581d..1f3b208 100644 --- a/gb/gb.go +++ b/gb/gb.go
@@ -7,6 +7,7 @@ "github.com/Masterminds/glide/cfg" "github.com/Masterminds/glide/msg" + gpath "github.com/Masterminds/glide/path" "github.com/Masterminds/glide/util" ) @@ -24,7 +25,7 @@ return []*cfg.Dependency{}, nil } - msg.Info("Found GB manifest file in %s\n", dir) + msg.Info("Found GB manifest file in %s", gpath.StripBasepath(dir)) buf := []*cfg.Dependency{} file, err := os.Open(path) if err != nil {
diff --git a/godep/godep.go b/godep/godep.go index 5e937a1..aad445b 100644 --- a/godep/godep.go +++ b/godep/godep.go
@@ -10,6 +10,7 @@ "github.com/Masterminds/glide/cfg" "github.com/Masterminds/glide/msg" + gpath "github.com/Masterminds/glide/path" "github.com/Masterminds/glide/util" ) @@ -52,7 +53,7 @@ if _, err := os.Stat(path); err != nil { return []*cfg.Dependency{}, nil } - msg.Info("Found Godeps.json file in %s\n", dir) + msg.Info("Found Godeps.json file in %s", gpath.StripBasepath(dir)) buf := []*cfg.Dependency{}
diff --git a/gom/gom.go b/gom/gom.go index 7d11262..76305e4 100644 --- a/gom/gom.go +++ b/gom/gom.go
@@ -7,6 +7,7 @@ "github.com/Masterminds/glide/cfg" "github.com/Masterminds/glide/msg" + gpath "github.com/Masterminds/glide/path" "github.com/Masterminds/glide/util" ) @@ -24,7 +25,7 @@ return []*cfg.Dependency{}, nil } - msg.Info("Found Gomfile in %s\n", dir) + msg.Info("Found Gomfile in %s", gpath.StripBasepath(dir)) buf := []*cfg.Dependency{} goms, err := parseGomfile(path)
diff --git a/gpm/gpm.go b/gpm/gpm.go index 6229937..45e316f 100644 --- a/gpm/gpm.go +++ b/gpm/gpm.go
@@ -11,6 +11,7 @@ "github.com/Masterminds/glide/cfg" "github.com/Masterminds/glide/msg" + gpath "github.com/Masterminds/glide/path" ) // Has indicates whether a Godeps file exists. @@ -29,7 +30,7 @@ msg.Info("Godeps is a directory. This is probably a Godep project.\n") return []*cfg.Dependency{}, nil } - msg.Info("Found Godeps file in %s\n", dir) + msg.Info("Found Godeps file in %s", gpath.StripBasepath(dir)) buf := []*cfg.Dependency{}
diff --git a/path/path.go b/path/path.go index cfa46c2..9e7162f 100644 --- a/path/path.go +++ b/path/path.go
@@ -139,6 +139,12 @@ return base } +// StripBasepath removes the base directory from a passed in path. +func StripBasepath(p string) string { + bp := Basepath() + return strings.TrimPrefix(p, bp+string(os.PathSeparator)) +} + // IsLink returns true if the given FileInfo references a link. func IsLink(fi os.FileInfo) bool { return fi.Mode()&os.ModeSymlink == os.ModeSymlink