Merge pull request #292 from burnettk/filter-list-all-to-ensure-we-can-install-them

if a version is not installable via node-build, make sure it is not in list-all
This commit is contained in:
Augusto Moura 2022-03-14 15:03:28 -03:00 committed by GitHub
commit f9957f3f25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 9 deletions

View File

@ -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

View File

@ -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
)

View File

@ -97,3 +97,7 @@ print_index_tab(){
rm "$temp_headers_file"
}
nodebuild_wrapped() {
"$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-nodebuild.bash" "$@"
}