Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #63 from c9/arch
Browse files Browse the repository at this point in the history
fix arch detection issues
  • Loading branch information
nightwing authored Jun 20, 2016
2 parents fdc7dea + b1ab928 commit c0012fe
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,28 @@ start() {
check_deps

# Try to figure out the os and arch for binary fetching
local uname="$(uname -a)"
local uname="$(uname -s)"
local os=
local arch="$(uname -m)"
case "$uname" in
Linux\ *) os=linux ;;
Darwin\ *) os=darwin ;;
SunOS\ *) os=sunos ;;
FreeBSD\ *) os=freebsd ;;
Linux*) os=linux ;;
Darwin*) os=darwin ;;
SunOS*) os=sunos ;;
FreeBSD*) os=freebsd ;;
CYGWIN*) os=windows ;;
MINGW*) os=windows ;;
esac
case "$uname" in
*x86_64*) arch=x64 ;;
*i*86*) arch=x86 ;;
case "$arch" in
*armv6l*) arch=arm-pi ;;
*armv7l*) arch=arm-pi ;;
*x86_64*) arch=x64 ;;
*i*86*) arch=x86 ;;
esac

if [ "$arch" == "x64" ] && [[ $HOSTTYPE == i*86 ]]; then
arch=x86 # check if 32 bit bash is installed on 64 bit kernel
fi

if [ "$arch" == "arm-pi" ]; then
NODE_VERSION=$NODE_VERSION_ARM_PI
fi
Expand Down Expand Up @@ -238,6 +242,11 @@ ensure_local_gyp() {
fi
"$NPM" config -g set python "$PYTHON"
"$NPM" config -g set unsafe-perm true

local GYP_PATH=$C9_DIR/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
if [ -f "$GYP_PATH" ]; then
ln -s "$GYP_PATH" "$C9_DIR"/node/bin/node-gyp &> /dev/null || :
fi
}

node(){
Expand Down

0 comments on commit c0012fe

Please sign in to comment.