diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-14 18:35:47 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-14 18:35:47 +1000 |
commit | c476dfc1cb352639f79031da3c4811175dcf4591 (patch) | |
tree | 46a556bd257c6e50d39daac45782a5d81f6ae552 /pkg/commands | |
parent | bde6182c949918964612b14c0957b7683d9f98bd (diff) |
fix open command
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/os.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index d7fa6fc39..9f9819a5a 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -109,7 +109,7 @@ func (c *OSCommand) GetOpenCommand() (string, string, error) { "open": "", } for name, trail := range trailMap { - if out, _ := c.RunCommandWithOutput("which " + name); out != "exit status 1" { + if err := c.RunCommand("which " + name); err == nil { return name, trail, nil } } @@ -137,7 +137,8 @@ func (c *OSCommand) OpenFile(filename string) (*exec.Cmd, error) { if err != nil { return nil, err } - return nil, c.RunCommand(cmdName + " " + filename + cmdTrail) // TODO: ensure this works given that it's not rundirectcommand + err = c.RunCommand(cmdName + " " + filename + cmdTrail) // TODO: test on linux + return nil, err } // EditFile opens a file in a subprocess using whatever editor is available, |