Skip to content

Commit

Permalink
Fix: linux path abs useless judgment
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Nov 28, 2022
1 parent d939cda commit e795e4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ func (c *console) buildCmd(args []string) (*exec.Cmd, error) {
if len(args) == 0 {
return nil, ErrInvalidCmd
}
if file, err := exec.LookPath(args[0]); err != nil {
return nil, err
} else if args[0], err = filepath.Abs(file); err != nil {
var err error
if args[0], err = exec.LookPath(args[0]); err != nil {
return nil, err
}
cmd := exec.Command(args[0], args[1:]...)
Expand Down

0 comments on commit e795e4a

Please sign in to comment.