diff --git a/bin/install b/bin/install index 9a030d6..110e8e3 100755 --- a/bin/install +++ b/bin/install @@ -28,17 +28,12 @@ try_to_update_nodebuild() { printf " $(colored $YELLOW WARNING): Updating node-build failed with exit code %s. The installation will try to continue with already installed local defintions. To debug what went -wrong try to manually updating node-build by running: \`asdf %s update nodebuild\` +wrong, try to manually update node-build by running: \`asdf %s update nodebuild\` \n" "$exit_code" "$ASDF_NODEJS_PLUGIN_NAME" fi } -nodebuild_wrapped() { - "$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-nodebuild.bash" "$@" -} - - install_canon_version() { local install_type="$1" version="$2" install_path="$3" local args=() @@ -101,7 +96,7 @@ install_default_npm_packages() { filtered_packages=$(grep -vE "^\s*#" < "$default_npm_packages_file") - if [ "${filtered_packages-}" ]; then + if [ "${filtered_packages-}" ]; then printf "$(colored $CYAN "Installing the following default packages globally: ")" xargs printf "%s, " <<< "$filtered_packages" printf "\x8\x8 \n" # Cleanup last comma diff --git a/bin/list-all b/bin/list-all index 7915513..3162432 100755 --- a/bin/list-all +++ b/bin/list-all @@ -12,8 +12,17 @@ set -o nounset -o pipefail -o errexit # shellcheck source=../lib/utils.sh source "$(dirname "$0")/../lib/utils.sh" +function print_only_fully_numeric_items() { + local version_numbers="$1" + grep -E '^[0-9.]+$' <<< "$version_numbers" +} + +"$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-update-nodebuild.bash" &> /dev/null + +all_definitions_from_node_build="$(nodebuild_wrapped --definitions)" + # Print echo $( - # Only print the first column of candidates - print_index_tab | cut -f1 | tac + print_only_fully_numeric_items "$all_definitions_from_node_build" + printf "%s\n" lts-{argon,boron,carbon,dubnium,erbium,fermium,gallium} lts ) diff --git a/lib/utils.sh b/lib/utils.sh index 2af9d5d..a390123 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -97,3 +97,7 @@ print_index_tab(){ rm "$temp_headers_file" } + +nodebuild_wrapped() { + "$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-nodebuild.bash" "$@" +}