Skip to content

Commit

Permalink
updated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dharma-09 committed Sep 20, 2024
1 parent f07d67c commit aae0502
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ee/allowedcmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ func validatedCommand(ctx context.Context, knownPath string, arg ...string) (*ex
// We expect to know the exact location for allowlisted commands on all
// OSes except for a few Linux distros.
if !allowSearchPath() {
return nil, fmt.Errorf("%w: %s",ErrCommandNotFound, knownPath)
return nil, fmt.Errorf("%w: %s", ErrCommandNotFound, knownPath)
}

cmdName := filepath.Base(knownPath)
if foundPath, err := exec.LookPath(cmdName); err == nil {
return newCmd(ctx, foundPath, arg...), nil
}

return nil, fmt.Errorf("%w: %s and could not be located elsewhere", ErrCommandNotFound, knownPath)
return nil, fmt.Errorf("%w: not found at %s and could not be located elsewhere", ErrCommandNotFound, knownPath)
}

func allowSearchPath() bool {
Expand Down
2 changes: 1 addition & 1 deletion ee/tables/homebrew/upgradeable.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (t *Table) generate(ctx context.Context, queryContext table.QueryContext) (
if err != nil {
if errors.Is(err, allowedcmd.ErrCommandNotFound) {
// No data, no error
return nil, nil
return nil, err
}
return nil, fmt.Errorf("failure allocating allowedcmd.Brew: %w", err)
}
Expand Down

0 comments on commit aae0502

Please sign in to comment.