Address shellcheck warnings

This commit is contained in:
Trevor Brown 2020-01-29 08:04:39 -05:00
parent 7d3fb89608
commit a6b8996f2a
3 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,8 @@ EOF
asdf_extension_cmds() {
local plugins_path ext_cmds
plugins_path="$(get_plugin_path)"
# shellcheck disable=SC2012 # use find instead of ls -1
# use find instead of ls -1
# shellcheck disable=SC2012
ext_cmds="$(ls -1 "$plugins_path"/*/bin/command* 2>/dev/null | sed "s#$plugins_path/# asdf #;"'s#/bin/command##g;s#-# #g')"
if test -n "$ext_cmds"; then
echo "$ext_cmds" | cut -d' ' -f 4 | uniq | while read -r plugin; do

View File

@ -10,7 +10,7 @@ latest_command() {
# pattern from xxenv-latest (https://github.com/momo-lab/xxenv-latest)
asdf list-all "$plugin_name" "$query" |
grep -vE "(^Available versions:|-src|-dev|-latest|-stm|[-\.]rc|-alpha|-beta|[-\.]pre|-next|(a|b|c)[0-9]+|snapshot|master)" |
grep -vE "(^Available versions:|-src|-dev|-latest|-stm|[-\\.]rc|-alpha|-beta|[-\\.]pre|-next|(a|b|c)[0-9]+|snapshot|master)" |
sed 's/^\s\+//' |
sort --version-sort |
tail -1

View File

@ -13,7 +13,7 @@ list_all_command() {
if [[ $query ]]; then
versions=$(echo "$versions" |
tr ' ' '\n' |
grep -E "^\s*$query" |
grep -E "^\\s*$query" |
tr '\n' ' ')
fi