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

fix: add asdf to list of banned commands #1224

Merged
merged 1 commit into from May 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/asdf.sh
Expand Up @@ -13,7 +13,7 @@ asdf() {
;;
*)
# forward other commands to asdf script
command asdf "$command" "$@"
command asdf "$command" "$@" # asdf_allow: ' asdf '
;;

esac
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/reshim.bash
Expand Up @@ -97,7 +97,7 @@ write_shim_script() {
cat <<EOF >"$shim_path"
#!/usr/bin/env bash
# asdf-plugin: ${plugin_name} ${version}
exec $(asdf_dir)/bin/asdf exec "${executable_name}" "\$@"
exec $(asdf_dir)/bin/asdf exec "${executable_name}" "\$@" # asdf_allow: ' asdf '
EOF
fi

Expand Down
6 changes: 6 additions & 0 deletions test/banned_commands.bats
Expand Up @@ -41,6 +41,12 @@ banned_commands_regex=(
# match certain filename patterns.
# https://github-wiki-see.page/m/koalaman/shellcheck/wiki/SC2012
'\bls '

# Ban recusive asdf calls as they are inefficient and may introduce bugs.
# If you find yourself needing to invoke an `asdf` command from within
# asdf code, please source the appropriate file and invoke the
# corresponding function.
'\basdf '
)

setup() {
Expand Down