Skip to content

Commit

Permalink
added error message to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperspencer committed Dec 27, 2023
1 parent be42d17 commit 504be6e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,7 @@ func Locally(repo types.Repo, l types.Local, dry bool) bool {
break
}

if err == git.ErrRepositoryNotExists {
dir, _ := filepath.Abs(repo.Name)
sub.Warn().
Str("repo", repo.Name).
Msgf("removing %s", dir)
os.RemoveAll(repo.Name)
}

sub.Warn().
sub.Warn().Err(err).
Msgf("retry %s from %s", types.Red(x), types.Red(tries))

time.Sleep(5 * time.Second)
Expand All @@ -170,6 +162,13 @@ func Locally(repo types.Repo, l types.Local, dry bool) bool {

err := updateRepository(repo.Name, auth, dry, l)
if err != nil {
if err == git.ErrRepositoryNotExists {
dir, _ := filepath.Abs(repo.Name)
sub.Warn().
Str("repo", repo.Name).
Msgf("removing %s", dir)
os.RemoveAll(repo.Name)
}
if err == git.NoErrAlreadyUpToDate {
sub.Info().
Msg(err.Error())
Expand All @@ -183,7 +182,7 @@ func Locally(repo types.Repo, l types.Local, dry bool) bool {
} else {
os.RemoveAll(repo.Name)
sub.Warn().
Str("repo", repo.Name).
Str("repo", repo.Name).Err(err).
Msgf("retry %s from %s", types.Red(x), types.Red(tries))

time.Sleep(5 * time.Second)
Expand Down

0 comments on commit 504be6e

Please sign in to comment.