Adding strip-vcs to get command
diff --git a/action/get.go b/action/get.go index b1c0a46..e27030b 100644 --- a/action/get.go +++ b/action/get.go
@@ -15,7 +15,7 @@ // Get fetches one or more dependencies and installs. // // This includes resolving dependency resolution and re-generating the lock file. -func Get(names []string, installer *repo.Installer, insecure, skipRecursive bool) { +func Get(names []string, installer *repo.Installer, insecure, skipRecursive, strip bool) { base := gpath.Basepath() EnsureGopath() EnsureVendorDir() @@ -63,7 +63,9 @@ } // VendoredCleanup - if installer.UpdateVendored { + // When stripping VCS happens this will happen as well. No need for double + // effort. + if installer.UpdateVendored && !strip { repo.VendoredCleanup(confcopy) } @@ -77,6 +79,11 @@ } else { msg.Warn("Skipping lockfile generation because full dependency tree is not being calculated") } + + if strip { + msg.Info("Removing version control data from vendor directory...") + gpath.StripVcs() + } } func writeLock(conf, confcopy *cfg.Config, base string) {
diff --git a/glide.go b/glide.go index a1b6f64..23c4745 100644 --- a/glide.go +++ b/glide.go
@@ -207,6 +207,10 @@ Name: "resolve-current", Usage: "Resolve dependencies for only the current system rather than all build modes.", }, + cli.BoolFlag{ + Name: "strip-vcs, s", + Usage: "Removes version control metada (e.g, .git directory) from the vendor folder.", + }, }, Action: func(c *cli.Context) { if len(c.Args()) < 1 { @@ -228,7 +232,7 @@ inst.ResolveAllFiles = c.Bool("all-dependencies") packages := []string(c.Args()) insecure := c.Bool("insecure") - action.Get(packages, inst, insecure, c.Bool("no-recursive")) + action.Get(packages, inst, insecure, c.Bool("no-recursive"), c.Bool("strip-vcs")) }, }, { @@ -405,7 +409,7 @@ Usage: "Copy dependencies from the GOPATH if they exist there.", }, cli.BoolFlag{ - Name: "strip-vcs", + Name: "strip-vcs, s", Usage: "Removes version control metada (e.g, .git directory) from the vendor folder.", }, }, @@ -493,7 +497,7 @@ Usage: "Resolve dependencies for only the current system rather than all build modes.", }, cli.BoolFlag{ - Name: "strip-vcs", + Name: "strip-vcs, s", Usage: "Removes version control metada (e.g, .git directory) from the vendor folder.", }, },