Update setup-node-ubuntu.bash to use portable `head -n` syntax.
This commit is contained in:
parent
fb0a8f6372
commit
0948a728c3
|
@ -241,10 +241,10 @@ fi
|
||||||
|
|
||||||
if [ -z "$NODEJS_VER" ]; then
|
if [ -z "$NODEJS_VER" ]; then
|
||||||
if [ -n "$(type -p curl)" ]; then
|
if [ -n "$(type -p curl)" ]; then
|
||||||
NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | head -2 | tail -1 | cut -f 1) \
|
NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | head -n 2 | tail -n 1 | cut -f 1) \
|
||||||
|| echo 'error automatically determining current node.js version'
|
|| echo 'error automatically determining current node.js version'
|
||||||
elif [ -n "$(type -p wget)" ]; then
|
elif [ -n "$(type -p wget)" ]; then
|
||||||
NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | head -2 | tail -1 | cut -f 1) \
|
NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | head -n 2 | tail -n 1 | cut -f 1) \
|
||||||
|| echo 'error automatically determining current node.js version'
|
|| echo 'error automatically determining current node.js version'
|
||||||
else
|
else
|
||||||
echo "Found neither 'curl' nor 'wget'. Can't Continue."
|
echo "Found neither 'curl' nor 'wget'. Can't Continue."
|
||||||
|
|
Loading…
Reference in New Issue