Skip to content

Commit e795e4a

Browse files
committed
Fix: linux path abs useless judgment
1 parent d939cda commit e795e4a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

console/console.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ func (c *console) buildCmd(args []string) (*exec.Cmd, error) {
6161
if len(args) == 0 {
6262
return nil, ErrInvalidCmd
6363
}
64-
if file, err := exec.LookPath(args[0]); err != nil {
65-
return nil, err
66-
} else if args[0], err = filepath.Abs(file); err != nil {
64+
var err error
65+
if args[0], err = exec.LookPath(args[0]); err != nil {
6766
return nil, err
6867
}
6968
cmd := exec.Command(args[0], args[1:]...)

0 commit comments

Comments
 (0)