-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhook_standalone.sh
executable file
·91 lines (75 loc) · 1.81 KB
/
hook_standalone.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash -l
set -e
set -o pipefail
if [ -z "$1" ]; then
BUILD_OS=""
else
BUILD_OS=":$1";
fi
if [ -z "$BUILD_VERSION" ]; then
ARGS="-- "
else
ARGS="-- -c.buildVersion=$BUILD_VERSION -c.executableName=$EXE_NAME -c.extraMetadata.version=$BUILD_VERSION";
fi
if [ -z "$NOTARIZE" ] || [ "$NOTARIZE" = "false" ]; then
ARGS="${ARGS} -c.mac.notarize=false"
fi
if [ "prerelease" = "$RELEASE_TYPE" ]; then
export EP_PRE_RELEASE=true
fi
if [ -z "$NODE_EXE" ]; then NODE_EXE="node"; fi
if [ -z "$NPM_EXE" ]; then NPM_EXE="npm"; fi
$NPM_EXE config set script-shell /bin/bash
NODE_DIR=$(dirname $(which $NPM_EXE))
export PATH="$NODE_DIR:$PATH"
export BUILD_OS=$BUILD_OS
export BUILD_VERSION=$BUILD_VERSION
export NOTARIZE=$NOTARIZE
export NODE_EXE=$NODE_EXE
export NODE_DIR=$NODE_DIR
export ARGS=$ARGS
export USE_HARD_LINKS=false
echo "building with node version `$NODE_EXE --version`, args: $ARGS"
echo "INSTALLING cables_dev DEPENDENCIES"
$NPM_EXE install
echo "BUILDING shared"
cd shared
git pull
$NPM_EXE install
$NPM_EXE run build
cd ..
echo "BUILDING cables"
cd cables
git pull
$NPM_EXE install
$NPM_EXE run build
cd ..
echo "BUILDING cables_ui"
cd cables_ui
git pull
$NPM_EXE install
$NPM_EXE run build
cd ..
echo "BUILDING cables_electron"
cd cables_electron
git pull
$NPM_EXE install
$NPM_EXE run build
echo "INSTALLING standalone op-modules"
cd dist/ops/extensions/Ops.Extension.Standalone/
for dir in `find . -maxdepth 1 -type d -name 'Ops.Extension.Standalone.*'`; do
cd $dir;
name=`basename $dir`.json;
set +e
json=`cat $name | jq -r '.dependencies[] | select( .type == "npm") | .src '`
set -e
for m in $json; do
echo "$name: installing $m";
npm install --prefix ./ $m --no-save;
done
cd ..
done
echo "PACKAGING cables_electron"
$NPM_EXE run dist$BUILD_OS $ARGS
cd ..
echo "DONE"