2020-05-08 11:48:49 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
main() {
|
|
|
|
cd "$(dirname "${0}")/../.."
|
2021-09-09 03:05:49 +08:00
|
|
|
|
2020-05-16 22:55:46 +08:00
|
|
|
source ./ci/lib.sh
|
2020-05-08 11:48:49 +08:00
|
|
|
|
2022-12-09 01:44:27 +08:00
|
|
|
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
2020-05-28 04:39:17 +08:00
|
|
|
RELEASE_PATH+=-standalone
|
2020-05-08 11:48:49 +08:00
|
|
|
|
2023-09-28 11:17:47 +08:00
|
|
|
# We cannot get the path to Node from $PATH (for example via `which node`)
|
|
|
|
# because Yarn shims a script called `node` and we would end up just copying
|
|
|
|
# that script. Instead we run Node and have it print its actual path.
|
2020-05-08 11:48:49 +08:00
|
|
|
local node_path
|
2023-09-28 11:17:47 +08:00
|
|
|
node_path="$(node <<< 'console.info(process.execPath)')"
|
2020-05-08 11:48:49 +08:00
|
|
|
|
|
|
|
mkdir -p "$RELEASE_PATH/bin"
|
2021-09-09 03:05:49 +08:00
|
|
|
mkdir -p "$RELEASE_PATH/lib"
|
2020-05-08 11:48:49 +08:00
|
|
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
2020-05-22 07:18:50 +08:00
|
|
|
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
2020-05-08 11:48:49 +08:00
|
|
|
|
2023-06-22 03:00:52 +08:00
|
|
|
chmod 755 "$RELEASE_PATH/lib/node"
|
|
|
|
|
2022-08-05 00:03:28 +08:00
|
|
|
pushd "$RELEASE_PATH"
|
2022-09-07 02:03:27 +08:00
|
|
|
npm install --unsafe-perm --omit=dev
|
2022-08-05 00:03:28 +08:00
|
|
|
popd
|
2020-05-08 11:48:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|