summaryrefslogtreecommitdiffstats
path: root/pkg/utils
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-31 18:43:54 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-09-01 11:38:32 +1000
commitae0d88f855773dd76432487509f9af13f987a812 (patch)
tree849249573b2b809a0b9e406cd15ee000cc92ec76 /pkg/utils
parentcff1dee6dcb303e789b804bbe270a0032f0b76a7 (diff)
WIP using runDirectCommand with xdg-open
Diffstat (limited to 'pkg/utils')
-rw-r--r--pkg/utils/utils.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go
index 62706559e..1d5f0f273 100644
--- a/pkg/utils/utils.go
+++ b/pkg/utils/utils.go
@@ -90,3 +90,11 @@ func Loader() string {
index := nanos / 50000000 % int64(len(characters))
return characters[index : index+1]
}
+
+// ResolvePlaceholderString populates a template with values
+func ResolvePlaceholderString(str string, arguments map[string]string) string {
+ for key, value := range arguments {
+ str = strings.Replace(str, "{{"+key+"}}", value, -1)
+ }
+ return str
+}