diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-01 14:33:01 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-01 14:33:01 +1000 |
commit | d31520261f0ffc4cb93e29476e39ace45e813fc8 (patch) | |
tree | 8ebf28daf9937ccd1ade4882686253ac2a04fbb6 /pkg/commands/os.go | |
parent | ad880e2d56cd9ab3841dd077d47979202c509460 (diff) |
introduce platform specific defaults
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 9fc3a2bc0..834c45376 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -51,7 +51,6 @@ func (c *OSCommand) RunCommandWithOutput(command string) (string, error) { c.Log.WithField("command", command).Info("RunCommand") splitCmd := str.ToArgv(command) c.Log.Info(splitCmd) - return sanitisedCommandOutput( c.command(splitCmd[0], splitCmd[1:]...).CombinedOutput(), ) @@ -98,23 +97,15 @@ func sanitisedCommandOutput(output []byte, err error) (string, error) { return outputString, nil } -// getOpenCommand get open command -func (c *OSCommand) getOpenCommand() string { - if c.Config.GetUserConfig().IsSet("os.openCommand") { - return c.Config.GetUserConfig().GetString("os.openCommand") - } - return c.Platform.openCommand -} - // OpenFile opens a file with the given func (c *OSCommand) OpenFile(filename string) error { - commandTemplate := c.getOpenCommand() + commandTemplate := c.Config.GetUserConfig().GetString("os.openCommand") templateValues := map[string]string{ "filename": c.Quote(filename), } command := utils.ResolvePlaceholderString(commandTemplate, templateValues) - _, err := c.RunCommandWithOutput(command) + err := c.RunCommand(command) return err } |