Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Fix update repo on all
Browse files Browse the repository at this point in the history
Signed-off-by: Bruna Tavares <bruna.silva@zup.com.br>
  • Loading branch information
brunasilvazup committed Nov 30, 2020
1 parent 89883c0 commit f1bb26a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/cmd/update_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ func (up updateRepoCmd) runPrompt() CommandRunnerFunc {
}

var reposName []string
var externalRepos formula.Repos
reposName = append(reposName, updateOptionAll)
for i := range repos {
if !repos[i].IsLocal {
externalRepos = append(externalRepos, repos[i])
reposName = append(reposName, repos[i].Name.String())
}
}
Expand All @@ -106,9 +108,9 @@ func (up updateRepoCmd) runPrompt() CommandRunnerFunc {
var repoToUpdate []formula.Repo

if flagAll {
repoToUpdate = repos
repoToUpdate = externalRepos
} else {
for i := range repos {
for i := range externalRepos {
if repos[i].Name == formula.RepoName(name) {
repoToUpdate = append(repoToUpdate, repos[i])
break
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/update_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestUpdateRepoRun(t *testing.T) {
Url: "https://github.com/owner/repo",
Token: "token",
Priority: 1,
IsLocal: true,
}

type in struct {
Expand Down

0 comments on commit f1bb26a

Please sign in to comment.