-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
prepare_node.sh
62 lines (49 loc) · 1.78 KB
/
prepare_node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
##########################################################################################
#
#
##########################################################################################
export VERSION_FILE=/usr/include/opencascade/Standard_Version.hxx
grep -i "#define OCC_VERSION_COMPLETE" ${VERSION_FILE} ;
lscpu ;
cmake --version ;
#set NPROC=`nproc`
# on linux:
# NPROC=$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)
# on MacOS
# NPROC=$(sysctl -n hw.ncpu)
# on both
NPROC=$(node -p "os.cpus().length")
echo "Number of processors =" ${NPROC}
PATH=$PATH:`pwd`/node_modules/.bin
uname -a
echo "NODE PATH = `which node`"
echo "NODE VERSION = `node --version`"
echo "NODE = `node -p 'process.platform + "@" + process.arch'`"
echo "NPM VERSION = `npm --version`"
# figure out if we should publish
PUBLISH_BINARY=false
# if we are building a tag then publish
echo $TRAVIS_BRANCH
export CURRENT BRANCH=`git describe --tags --always HEAD`
echo "CURRENT BRANCH = $CURRENT_BRANCH"
if [[ "$TRAVIS_BRANCH" == "$CURRENT_BRANCH" ]]; then PUBLISH_BINARY=true; fi;
echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY
# Cleanup the output of npm
npm config set progress false
npm config set spin false
if [[ ! -z $TRAVIS_ELECTRON_VERSION ]]; then
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
fi
export npm_config_target=$TRAVIS_ELECTRON_VERSION
export npm_config_arch=$ARCH
export npm_config_disturl=https://atom.io/download/atom-shell
export npm_config_runtime=electron
npm install --arch=$ARCH electron@$TRAVIS_ELECTRON_VERSION
npm install electron-mocha
echo "installed Electron $TRAVIS_ELECTRON_VERSION"
fi
# git submodule update --depth 50 --init --recursive
npm install --build-from-source