forked from facebook-atom/nuclide-prebuilt-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepublish.sh
executable file
·46 lines (38 loc) · 1.45 KB
/
prepublish.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
#!/bin/bash
set -e
if [[ -n "$npm_config_argv" ]]; then
# See https://github.com/npm/npm/issues/3059
npm_first_arg=$(node -p 'JSON.parse(process.env.npm_config_argv).original[0]')
[[ $npm_first_arg != "publish" ]] && exit
fi
VERSION=$(node -p 'require("./package.json").version')
BINARY_HOST_MIRROR="https://github.com/facebooknuclide/nuclide-prebuilt-libs/releases/download/v${VERSION}/"
TARGETS=(
"--target_platform=linux --runtime=electron --target=1.6.5"
"--target_platform=linux --runtime=electron --target=1.7.0"
"--target_platform=linux --runtime=node --target=7.0.0"
"--target_platform=linux --runtime=node --target=8.9.3"
"--target_platform=darwin --runtime=electron --target=1.6.5"
"--target_platform=darwin --runtime=electron --target=1.7.0"
"--target_platform=darwin --runtime=node --target=7.0.0"
"--target_platform=darwin --runtime=node --target=8.9.3"
"--target_platform=win32 --runtime=electron --target=1.6.5"
"--target_platform=win32 --runtime=electron --target=1.7.0"
"--target_platform=win32 --runtime=node --target=7.0.0"
"--target_platform=win32 --runtime=node --target=8.9.3"
)
MODULE_NAMES=(
"ctags"
"fuzzy-native"
"keytar"
"pty"
)
for module_name in "${MODULE_NAMES[@]}"; do
pushd "$module_name"
npm install
for target in "${TARGETS[@]}"; do
env "npm_config_${module_name}_binary_host_mirror="$BINARY_HOST_MIRROR"" \
./node_modules/.bin/node-pre-gyp install $target
done
popd
done