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

Deprecate backticks #2430

Merged
merged 5 commits into from
Oct 30, 2024
Merged

Deprecate backticks #2430

merged 5 commits into from
Oct 30, 2024

Conversation

offby1
Copy link
Contributor

@offby1 offby1 commented Oct 15, 2024

Just a sentence suggesting people use shell instead of backticks.

Oh look, I just used backticks up there!! :-)

@laniakea64
Copy link
Contributor

laniakea64 commented Oct 15, 2024

Why deprecate?

Backticks are still useful for concisely expressing simple, fixed (i.e. not just expressions) commands. Using shell() where a backtick can do the job doesn't address any potentially-unexpected behavior and doesn't add clarity.

Also, backticks are not equivalent to shell():

backtick := `echo "$0" "$@"`
shell := shell('echo "$0" "$@"')
$ just --evaluate
backtick := "sh"
shell    := "echo "$0" "$@""

Mentioning shell() in this part of the README seems reasonable to me, but maybe better along the lines of "More flexible and more powerful command invocations can be achieved with the shell() function" and written at the end of the section

@casey casey enabled auto-merge (squash) October 30, 2024 22:28
@casey casey merged commit b063940 into casey:master Oct 30, 2024
5 checks passed
@casey
Copy link
Owner

casey commented Oct 30, 2024

Nice, merged! Yah, unlike in shell scripts, backticks in just don't have any weird behaviors, so no need to deprecated them. The note is nice though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants