Skip to content

Commit

Permalink
feat: delete sourcee will use preset alias
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Jun 16, 2023
1 parent 153d431 commit 13c9fd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ func (action *actionImpl) Drop() int {
})
return 1
}
// Set npm as default choose
action.conf.SetCurrentPath(source.DefaultKey[source.Npm])
logger.PrintTextWithColor(os.Stdout, func(c logger.Colors) string {
return fmt.Sprintf("%s%s%s\n", c.Green, "remove registry success", c.Reset)
})
Expand Down
6 changes: 5 additions & 1 deletion internal/source/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func NewGrmConf() *GrmConfig {
func (g *GrmConfig) ListAllPath() {
aliases, files := g.scanner()
list := make([]string, 0, len(aliases)+len(SourceToString))
list = append(list, SourceToString...)
for _, s := range SourceToString {
if s != System.String() {
list = append(list, s)
}
}
list = append(list, aliases...)
g.files = files
g.aliases = aliases
Expand Down

0 comments on commit 13c9fd9

Please sign in to comment.