forked from heroku/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkspace
More file actions
executable file
·57 lines (51 loc) · 1.39 KB
/
workspace
File metadata and controls
executable file
·57 lines (51 loc) · 1.39 KB
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
#!/usr/bin/env bash
source ./scripts/_init
set -x
function build () {
setarch $ARCH
# setup workspace
o="$WORKSPACE_DIR"
rm -rf "${o}"
cp -r "$BASE_DIR" "$o"
"$ROOT_DIR/scripts/build/_fetch_node_binary" "${o}/bin"
# create bin runner
if [ "${OS}" == "windows" ]; then
cat << EOF > "${o}/bin/heroku.cmd"
@echo off
set CLI_BINPATH=%~dp0\\heroku.cmd
"%~dp0\\node.exe" "%~dp0\\heroku.js" %*
EOF
else
cat << EOF > "${o}/bin/heroku"
#!/usr/bin/env bash
set -e
get_script_dir () {
SOURCE="\${BASH_SOURCE[0]}"
# While \$SOURCE is a symlink, resolve it
while [ -h "\$SOURCE" ]; do
DIR="\$( cd -P "\$( dirname "\$SOURCE" )" && pwd )"
SOURCE="\$( readlink "\$SOURCE" )"
# If \$SOURCE was a relative symlink (so no "/" as prefix, need to resolve it relative to the symlink base directory
[[ \$SOURCE != /* ]] && SOURCE="\$DIR/\$SOURCE"
done
DIR="\$( cd -P "\$( dirname "\$SOURCE" )" && pwd )"
echo "\$DIR"
}
DIR=\$(get_script_dir)
# normalize home directory
CLI_HOME=\$(cd && pwd)
XDG_DATA_HOME=\${XDG_DATA_HOME:="\$CLI_HOME/.local/share"}
BIN_DIR="\$XDG_DATA_HOME/heroku/client/bin"
if [ -x "\$BIN_DIR/heroku" ] && [ ! "\$BIN_DIR" -ef "\$DIR" ]; then
"\$XDG_DATA_HOME/heroku/client/bin/heroku" "\$@"
else
CLI_BINPATH="\$DIR/heroku" "\$DIR/node" "\$DIR/heroku.js" "\$@"
fi
EOF
chmod +x "${o}/bin/heroku"
fi
}
for ARCH in "${ARCHS[@]}"; do
bg build
done
wait_all