@@ -7,31 +7,18 @@ import (
77 "strings"
88
99 "github.com/ActiveState/cli/internal/errs"
10- "github.com/ActiveState/cli/internal/fileutils"
1110 "github.com/ActiveState/cli/internal/locale"
1211 "github.com/ActiveState/cli/internal/logging"
1312 "github.com/ActiveState/cli/internal/osutils"
1413 "github.com/ActiveState/cli/internal/sighandler"
1514)
1615
17- func NewCommand (command string , args []string , env []string ) (* exec.Cmd , error ) {
18- if ! fileutils .IsExecutable (command ) {
19- err := locale .NewInputError (
20- "err_sscommon_command_not_executable" ,
21- "Command '{{.V0}}' is not an executable." ,
22- command ,
23- )
24- return nil , errs .AddTips (err ,
25- "Ensure that the targeted command is a valid executable." ,
26- "Checking environment vars like SHELL may help resolve this." ,
27- )
28- }
29-
16+ func NewCommand (command string , args []string , env []string ) * exec.Cmd {
3017 cmd := exec .Command (command , args ... )
3118 if env != nil {
3219 cmd .Env = append (os .Environ (), env ... )
3320 }
34- return cmd , nil
21+ return cmd
3522}
3623
3724// Start wires stdin/stdout/stderr into the provided command, starts it, and
@@ -66,7 +53,11 @@ func Start(cmd *exec.Cmd) chan error {
6653 return
6754 }
6855
69- errors <- errs .Wrap (err , "Command Failed: %s" , cmd .String ())
56+ err = errs .AddTips (errs .Wrap (err , "Command Failed: %s" , cmd .String ()),
57+ "Checking environment vars like SHELL may help resolve this." ,
58+ )
59+ errors <- err
60+
7061 return
7162 }
7263 }()
0 commit comments