mac node bin
This commit is contained in:
parent
0baa343c3e
commit
39466ef4a7
1 changed files with 4 additions and 2 deletions
|
|
@ -14,9 +14,11 @@ install_nodejs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_nodejs_mac() {
|
install_nodejs_mac() {
|
||||||
|
local NODE_BIN="$USER_HOME/node/bin/node"
|
||||||
|
|
||||||
# Check if node exists and meets minimum version
|
# Check if node exists and meets minimum version
|
||||||
if command -v node &> /dev/null; then
|
if [ -x "$NODE_BIN" ]; then
|
||||||
NODE_VERSION=$(node -v | sed 's/v//')
|
NODE_VERSION=$("$NODE_BIN" -v | sed 's/v//')
|
||||||
if [ "$(printf '%s\n' "$MINIMUM_VERSION" "$NODE_VERSION" | sort -V | awk 'NR==1')" = "$MINIMUM_VERSION" ]; then
|
if [ "$(printf '%s\n' "$MINIMUM_VERSION" "$NODE_VERSION" | sort -V | awk 'NR==1')" = "$MINIMUM_VERSION" ]; then
|
||||||
log "Node.js is already installed and meets the minimum version requirement."
|
log "Node.js is already installed and meets the minimum version requirement."
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue