Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Use shallow single-branch clone, remove git indices
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Apr 6, 2019
1 parent 0c9ebaf commit a4e09c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"path/filepath"

"github.com/jessevdk/go-flags"
"github.com/nritholtz/stdemuxerhook"
Expand Down Expand Up @@ -37,7 +38,7 @@ func init() {

func gitClone(repository string, version string, moduleName string) {
log.Printf("[*] Checking out %s of %s \n", version, repository)
cmd := exec.Command("git", "clone", "-b", version, repository, moduleName)
cmd := exec.Command("git", "clone", "--single-branch", "--depth=1", "-b", version, repository, moduleName)
cmd.Dir = opts.ModulePath
err := cmd.Run()
if err != nil {
Expand Down Expand Up @@ -71,5 +72,6 @@ func main() {
os.MkdirAll(opts.ModulePath, os.ModePerm)
for key, module := range config {
gitClone(module.Source, module.Version, key)
os.RemoveAll(filepath.Join(opts.ModulePath, key, ".git"))
}
}

0 comments on commit a4e09c8

Please sign in to comment.