fixes to clone
This commit is contained in:
parent
b80b7baa2d
commit
d473f80919
11
clone.go
11
clone.go
|
@ -6,7 +6,6 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"go.wit.com/lib/gui/shell"
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
@ -20,14 +19,14 @@ func clone(gopath string) (*gitpb.Repo, error) {
|
|||
}
|
||||
os.Setenv("REPO_AUTO_CLONE", "true")
|
||||
// pb, _ := forge.NewGoPath(gopath)
|
||||
check := forge.FindByGoPath(gopath)
|
||||
check := forge.FindAnyPath(filepath.Join(forge.GetGoSrc(), gopath))
|
||||
if check != nil {
|
||||
if check.IsValidDir() {
|
||||
// repo already exists and is valid
|
||||
return check, nil
|
||||
}
|
||||
}
|
||||
pb, err := forge.Clone(gopath)
|
||||
pb, err := forge.GoClone(gopath)
|
||||
if err != nil {
|
||||
log.Info("clone() could not download err:", err)
|
||||
return nil, err
|
||||
|
@ -37,12 +36,6 @@ func clone(gopath string) (*gitpb.Repo, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// double check it actually downloaded
|
||||
fullgitdir := filepath.Join(forge.GetGoSrc(), gopath, ".git")
|
||||
if !shell.IsDir(fullgitdir) {
|
||||
log.Info("repo cloned failed", filepath.Join(forge.GetGoSrc(), gopath))
|
||||
return nil, errors.New(fullgitdir + " was not created")
|
||||
}
|
||||
log.Info("go-clone clone() onward and upward")
|
||||
return pb, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue