hopefully this works better
This commit is contained in:
parent
3b714282df
commit
849378a95f
27
main.go
27
main.go
|
@ -37,14 +37,8 @@ func main() {
|
||||||
all := forge.Repos.SortByGoPath()
|
all := forge.Repos.SortByGoPath()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
check = all.Next()
|
check = all.Next()
|
||||||
if argv.Force {
|
if err := doMain(check); err != nil {
|
||||||
if err := doForce(check); err != nil {
|
badExit(check, err)
|
||||||
// badExit(check, err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := doSmart(check); err != nil {
|
|
||||||
// badExit(check, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,6 +49,9 @@ func main() {
|
||||||
badExit(nil, nil)
|
badExit(nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := doMain(check); err != nil {
|
||||||
|
badExit(check, err)
|
||||||
|
}
|
||||||
if argv.Force {
|
if argv.Force {
|
||||||
if err := doForce(check); err != nil {
|
if err := doForce(check); err != nil {
|
||||||
badExit(check, err)
|
badExit(check, err)
|
||||||
|
@ -140,3 +137,17 @@ func restoreFromGoPkg(repo *gitpb.Repo) error {
|
||||||
// try go.sum, but no error checking since it might not be there
|
// try go.sum, but no error checking since it might not be there
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func doMain(repo *gitpb.Repo) error {
|
||||||
|
if argv.Strict {
|
||||||
|
return doStrict(repo)
|
||||||
|
}
|
||||||
|
if argv.Force {
|
||||||
|
err := doForce(repo)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// if --force or --strict is not set, fall back to a "smart" guess
|
||||||
|
// at what the user probably would want
|
||||||
|
return doSmart(repo)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue