Skip to content

Commit

Permalink
Fixed issue of node-gyp on Android platform
Browse files Browse the repository at this point in the history
  • Loading branch information
bajrangCoder authored Feb 28, 2024
1 parent d1e2699 commit dba2d17
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions installServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

function install_packages {
if ! [ -x "$(command -v node)" ]; then
echo -e "\e[1;36m[*] Installing Nodejs\e[0m"
pkg install nodejs -y
echo -e "\e[1;36m[*] Installing Nodejs\e[0m"
pkg install nodejs -y
fi
if ! [ -x "$(command -v python)" ]; then
echo -e "\e[1;36m[*] Installing Python\e[0m"
pkg install python -y
echo -e "\e[1;36m[*] Installing Python\e[0m"
pkg install python -y
fi
}

function setup_gyp_folder {
cd $HOME && mkdir -p .gyp && echo "{'variables': {'android_ndk_path': ''}}" > .gyp/include.gypi
}

if [[ "$OSTYPE" == "linux-android"* ]]; then
setup_gyp_folder
fi

install_packages

echo -e "\e[1;36m[*] Installing acodeX-server... \e[0m"
npm install -g acodex-server
echo -e '\e[1;32m`acodeX-server` installed successfully. Run `acodeX-server` to start the server. \e[0m'

0 comments on commit dba2d17

Please sign in to comment.