summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-03-29 11:42:37 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-04-13 13:14:00 +0200
commitb7e029adc7c5cf27ae2c5db768b971a959fa2449 (patch)
treeaf4e36f76508ac9690427dbc02e2aeee0b7f923d /pkg/commands
parent08d679c3a8524610e3f30e8d5ece71d522d70c68 (diff)
Don't set platform defaults on OSConfig struct immediately
Instead, query the platform defaults only if the config is empty. This will be necessary later to distinguish an empty config from a default config, so that we can give deprecation warnings.
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/oscommands/os.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go
index 11c964ca4..f66f25b72 100644
--- a/pkg/commands/oscommands/os.go
+++ b/pkg/commands/oscommands/os.go
@@ -79,6 +79,9 @@ func FileType(path string) string {
func (c *OSCommand) OpenFile(filename string) error {
commandTemplate := c.UserConfig.OS.OpenCommand
+ if commandTemplate == "" {
+ commandTemplate = config.GetPlatformDefaultConfig().OpenCommand
+ }
templateValues := map[string]string{
"filename": c.Quote(filename),
}
@@ -88,6 +91,9 @@ func (c *OSCommand) OpenFile(filename string) error {
func (c *OSCommand) OpenLink(link string) error {
commandTemplate := c.UserConfig.OS.OpenLinkCommand
+ if commandTemplate == "" {
+ commandTemplate = config.GetPlatformDefaultConfig().OpenLinkCommand
+ }
templateValues := map[string]string{
"link": c.Quote(link),
}