We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 398a2c5 commit 561349cCopy full SHA for 561349c
README.md
@@ -309,6 +309,8 @@ Task also adds the following functions:
309
path format to `/`.
310
- `FromSlash`: Oposite of `ToSlash`. Does nothing on Unix, but on Windows
311
converts a string from `\` path format to `/`.
312
+- `ExeExt`: Returns the right executable extension for the current OS
313
+ (`".exe"` for Windows, `""` for others).
314
315
Example:
316
variable_handling.go
@@ -91,6 +91,12 @@ func init() {
91
"ToSlash": func(path string) string {
92
return filepath.ToSlash(path)
93
},
94
+ "ExeExt": func() string {
95
+ if runtime.GOOS == "windows" {
96
+ return ".exe"
97
+ }
98
+ return ""
99
+ },
100
}
101
102
templateFuncs = sprig.TxtFuncMap()
0 commit comments