From d18287b041980a41dc9942b156db2fdc4101cd3a Mon Sep 17 00:00:00 2001 From: Devin Weaver Date: Wed, 7 Nov 2018 11:09:35 -0500 Subject: [PATCH] Speed up npm global installs Per issue #46 the `ASDF_INSTALL_VERSION` variable is not available in global NPM installs. Instead the `npm_config_node_version` is provided by NPM during this situation. This change offers a fallback in these cases. Since a version will be available this will significantly speed up the postinstall during global NPM installs. Fixes #46 --- bin/postinstall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/postinstall b/bin/postinstall index a07c2e7..d87b099 100755 --- a/bin/postinstall +++ b/bin/postinstall @@ -1,3 +1,3 @@ #!/usr/bin/env bash -asdf reshim nodejs "$ASDF_INSTALL_VERSION" +asdf reshim nodejs "${ASDF_INSTALL_VERSION:-$npm_config_node_version}"