Skip to content

Commit

Permalink
Error out on non-existent tool #149
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Dec 22, 2023
1 parent 59109f1 commit 694c0b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/uniget/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ var installCmd = &cobra.Command{

} else {
logging.Debug.Printfln("Adding %s to requested tools", strings.Join(args, ","))
requestedTools = tools.GetByNames(args)
for _, toolName := range args {
tool, err := tools.GetByName(toolName)
if err != nil {
return fmt.Errorf("unable to find tool %s: %s", toolName, err)
}
requestedTools.Tools = append(requestedTools.Tools, *tool)
}
}
logging.Debug.Printfln("Requested %d tool(s)", len(requestedTools.Tools))

Expand Down

0 comments on commit 694c0b5

Please sign in to comment.