clone() and misc other fixes and improvements
This commit is contained in:
parent
e796788e22
commit
340872788e
6
Makefile
6
Makefile
|
@ -15,12 +15,6 @@ vet:
|
|||
goimports:
|
||||
goimports -w *.go
|
||||
|
||||
redomod:
|
||||
rm -f go.*
|
||||
GO111MODULE= go mod init
|
||||
GO111MODULE= go mod tidy
|
||||
go mod edit -go=1.20
|
||||
|
||||
clean:
|
||||
rm -f *.pb.go
|
||||
-rm -f go.*
|
||||
|
|
|
@ -81,6 +81,7 @@ func (f *Forge) Clone(gopath string) (*gitpb.Repo, error) {
|
|||
// try a direct git clone against the gopath
|
||||
// cloneActual("helloworld", "/home/jcarr/go/src/go.wit.com/apps", "https://go.wit.com/apps/helloworld")
|
||||
if finalurl, err := cloneActual(dirname, basedir, url); err == nil {
|
||||
f.Repos.DeleteByGoPath(gopath)
|
||||
// git clone worked!
|
||||
return f.Repos.NewGoPath(f.goSrc, gopath, finalurl)
|
||||
}
|
||||
|
@ -94,6 +95,7 @@ func (f *Forge) Clone(gopath string) (*gitpb.Repo, error) {
|
|||
log.Info("findGoImport() DID NOT WORK", err)
|
||||
} else {
|
||||
if finalurl, err := cloneActual(dirname, basedir, url); err == nil {
|
||||
f.Repos.DeleteByGoPath(gopath)
|
||||
// git clone worked!
|
||||
return f.Repos.NewGoPath(f.goSrc, gopath, finalurl)
|
||||
}
|
||||
|
@ -106,6 +108,7 @@ func (f *Forge) Clone(gopath string) (*gitpb.Repo, error) {
|
|||
log.Info("go list failed", err)
|
||||
} else {
|
||||
if finalurl, err := cloneActual(dirname, basedir, url); err == nil {
|
||||
f.Repos.DeleteByGoPath(gopath)
|
||||
// git clone worked!
|
||||
return f.Repos.NewGoPath(f.goSrc, gopath, finalurl)
|
||||
}
|
||||
|
@ -115,6 +118,7 @@ func (f *Forge) Clone(gopath string) (*gitpb.Repo, error) {
|
|||
// try to parse a redirect
|
||||
|
||||
if finalurl, err := clonePathHack(dirname, basedir, gopath); err == nil {
|
||||
f.Repos.DeleteByGoPath(gopath)
|
||||
// WTF didn't go-import or go list work?
|
||||
return f.Repos.NewGoPath(f.goSrc, gopath, finalurl)
|
||||
}
|
|
@ -133,7 +133,7 @@ func (f *Forge) CheckoutMaster() bool {
|
|||
}
|
||||
|
||||
func (f *Forge) CheckoutUser() bool {
|
||||
log.Log(FORGEPBWARN, "running git checkout master everwhere")
|
||||
log.Log(FORGEPBWARN, "running git checkout user everwhere")
|
||||
var failed int = 0
|
||||
var count int = 0
|
||||
all := f.Repos.SortByGoPath()
|
||||
|
|
|
@ -65,6 +65,7 @@ func gitDirectoriesNew(srcDir string) ([]string, error) {
|
|||
switch fname {
|
||||
case "repos.pb":
|
||||
case "go.work":
|
||||
case "go.work.last":
|
||||
default:
|
||||
// todo: figure out a way to do padding for init()
|
||||
log.Info("WARNING: you have an untracked file outside of any .git repository:", path)
|
||||
|
|
Loading…
Reference in New Issue