summaryrefslogtreecommitdiff
path: root/replacer.go
diff options
context:
space:
mode:
authorKévin Dunglas <kevin@dunglas.fr>2022-10-07 11:54:41 +0200
committerGitHub <noreply@github.com>2022-10-07 05:54:41 -0400
commitb4e28af953aa02fb44f88c155956488b1f473348 (patch)
treeccd6e48fec9d77b9032b4798b2f9cbe40547eab9 /replacer.go
parentd46ba2e27fca841c289629fcc5ecf86b7f47d1f9 (diff)
replacer: working directory global placeholder (#5127)
Diffstat (limited to 'replacer.go')
-rw-r--r--replacer.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/replacer.go b/replacer.go
index 5797920..7f97f34 100644
--- a/replacer.go
+++ b/replacer.go
@@ -308,6 +308,10 @@ func globalDefaultReplacements(key string) (any, bool) {
return string(filepath.Separator), true
case "system.os":
return runtime.GOOS, true
+ case "system.wd":
+ // OK if there is an error; just return empty string
+ wd, _ := os.Getwd()
+ return wd, true
case "system.arch":
return runtime.GOARCH, true
case "time.now":