2015-11-13 13:39:38 +00:00
#!/bin/bash
if [ [ " $OSTYPE " = = "darwin" * ] ] ; then
realpath( ) { [ [ $1 = /* ] ] && echo " $1 " || echo " $PWD / ${ 1 #./ } " ; }
2017-02-21 18:45:32 +00:00
ROOT = $( dirname " $( dirname " $( realpath " $0 " ) " ) " )
2015-11-13 13:39:38 +00:00
npm_config_arch = x64
else
2017-02-21 18:45:32 +00:00
ROOT = $( dirname " $( dirname " $( readlink -f $0 ) " ) " )
2015-11-13 13:39:38 +00:00
# if [ -z $npm_config_arch ]; then
# npm_config_arch=$(node -p process.arch)
# echo "Warning: remember to set \$npm_config_arch to either x64 or ia32 to build the binaries for the right architecture. Picking '$npm_config_arch'."
# fi
fi
ELECTRON_VERSION = $(
2017-02-21 18:45:32 +00:00
cat " $ROOT " /package.json |
2015-11-13 13:39:38 +00:00
grep electronVersion |
sed -e 's/[[:space:]]*"electronVersion":[[:space:]]*"\([0-9.]*\)"\(,\)*/\1/'
)
ELECTRON_GYP_HOME = ~/.electron-gyp
mkdir -p $ELECTRON_GYP_HOME
2017-05-11 05:54:36 +00:00
npm_config_disturl = https://atom.io/download/electron \
2015-11-13 13:39:38 +00:00
npm_config_target = $ELECTRON_VERSION \
2016-05-03 14:18:56 +00:00
npm_config_runtime = electron \
2015-11-13 13:39:38 +00:00
HOME = $ELECTRON_GYP_HOME \
2016-05-03 14:18:56 +00:00
npm $*