Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add alias q for template function shellQuote #1603

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@pd93).
- Fix error when a file or directory in the project contained a special char
like `&`, `(` or `)` (#1551, #1584 by @andreynering).
- Added alias `q` for template function `shellQuote` (#1601 by @vergenzt)

## v3.36.0 - 2024-04-08

Expand Down
4 changes: 4 additions & 0 deletions internal/templater/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func init() {
return spew.Sdump(v)
},
}

// aliases
taskFuncs["q"] = taskFuncs["shellQuote"]

// Deprecated aliases for renamed functions.
taskFuncs["FromSlash"] = taskFuncs["fromSlash"]
taskFuncs["ToSlash"] = taskFuncs["toSlash"]
Expand Down
2 changes: 1 addition & 1 deletion website/docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ Task also adds the following functions:
converts a string from `/` path format to `\`.
- `exeExt`: Returns the right executable extension for the current OS (`".exe"`
for Windows, `""` for others).
- `shellQuote`: Quotes a string to make it safe for use in shell scripts. Task
- `shellQuote` (aliased to `q`): Quotes a string to make it safe for use in shell scripts. Task
uses [this Go function](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote)
for this. The Bash dialect is assumed.
- `splitArgs`: Splits a string as if it were a command's arguments. Task uses
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-latest/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ Task also adds the following functions:
converts a string from `/` path format to `\`.
- `exeExt`: Returns the right executable extension for the current OS (`".exe"`
for Windows, `""` for others).
- `shellQuote`: Quotes a string to make it safe for use in shell scripts. Task
- `shellQuote` (aliased to `q`): Quotes a string to make it safe for use in shell scripts. Task
uses [this Go function](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote)
for this. The Bash dialect is assumed.
- `splitArgs`: Splits a string as if it were a command's arguments. Task uses
Expand Down
Loading