summaryrefslogtreecommitdiffstats
path: root/pkg/commands/oscommands/os.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-03 15:15:26 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-04 09:07:15 +1100
commit95b2e9540a55973a6ab32dd4522648634ab15b0a (patch)
tree060e999ab894da8ecc6ead32cf0ccee64b05fd21 /pkg/commands/oscommands/os.go
parent3911575041ab67731a59dd597332bfc4543a9569 (diff)
update tests
Diffstat (limited to 'pkg/commands/oscommands/os.go')
-rw-r--r--pkg/commands/oscommands/os.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go
index 5a7c5e0bb..c5c6e3649 100644
--- a/pkg/commands/oscommands/os.go
+++ b/pkg/commands/oscommands/os.go
@@ -73,9 +73,7 @@ func NewCmdLogEntry(cmdStr string, span string, commandLine bool) CmdLogEntry {
}
// NewOSCommand os command runner
-func NewOSCommand(common *common.Common) *OSCommand {
- platform := getPlatform()
-
+func NewOSCommand(common *common.Common, platform *Platform) *OSCommand {
c := &OSCommand{
Common: common,
Platform: platform,
@@ -138,7 +136,6 @@ func FileType(path string) string {
return "file"
}
-// OpenFile opens a file with the given
func (c *OSCommand) OpenFile(filename string) error {
commandTemplate := c.UserConfig.OS.OpenCommand
templateValues := map[string]string{
@@ -148,7 +145,6 @@ func (c *OSCommand) OpenFile(filename string) error {
return c.Cmd.NewShell(command).Run()
}
-// OpenLink opens a file with the given
func (c *OSCommand) OpenLink(link string) error {
c.LogCommand(fmt.Sprintf("Opening link '%s'", link), false)
commandTemplate := c.UserConfig.OS.OpenLinkCommand