diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-03 14:54:55 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 4912205adb5e8e245b33b8e0d5581bcf0ec37e8a (patch) | |
tree | 90e28657c0af72cd0a880842f88750c01a32834d /pkg/commands/oscommands | |
parent | 9440dcf9de3214927125693e512cdc941ca4e123 (diff) |
remove viper
WIP
Diffstat (limited to 'pkg/commands/oscommands')
-rw-r--r-- | pkg/commands/oscommands/os.go | 4 | ||||
-rw-r--r-- | pkg/commands/oscommands/os_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index 8a0e1654e..3f5076dae 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -212,7 +212,7 @@ func sanitisedCommandOutput(output []byte, err error) (string, error) { // OpenFile opens a file with the given func (c *OSCommand) OpenFile(filename string) error { - commandTemplate := c.Config.GetUserConfig().GetString("os.openCommand") + commandTemplate := c.Config.GetUserConfig().OS.OpenCommand templateValues := map[string]string{ "filename": c.Quote(filename), } @@ -224,7 +224,7 @@ func (c *OSCommand) OpenFile(filename string) error { // OpenLink opens a file with the given func (c *OSCommand) OpenLink(link string) error { - commandTemplate := c.Config.GetUserConfig().GetString("os.openLinkCommand") + commandTemplate := c.Config.GetUserConfig().OS.OpenLinkCommand templateValues := map[string]string{ "link": c.Quote(link), } diff --git a/pkg/commands/oscommands/os_test.go b/pkg/commands/oscommands/os_test.go index 3383db215..78dfa48ec 100644 --- a/pkg/commands/oscommands/os_test.go +++ b/pkg/commands/oscommands/os_test.go @@ -103,7 +103,7 @@ func TestOSCommandOpenFile(t *testing.T) { for _, s := range scenarios { OSCmd := NewDummyOSCommand() OSCmd.Command = s.command - OSCmd.Config.GetUserConfig().Set("os.openCommand", "open {{filename}}") + OSCmd.Config.GetUserConfig().OS.OpenCommand = "open {{filename}}" s.test(OSCmd.OpenFile(s.filename)) } |