From 03dc8cd808fd27aa449ab9c4387cf130574003f0 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 11 Sep 2023 09:18:25 -0800 Subject: [PATCH] Propagate post-installation failures pipefail might be ideal here but not sure how wide the support is yet considering this may run on plain sh. --- ci/build/npm-postinstall.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 8c10c8cee..ee4d34913 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -113,29 +113,40 @@ install_with_yarn_or_npm() { # HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases. # The legacy behavior doesn't complain about pre-releases being used, falling back to that for now. # See https://github.com//pull/5071 - npm install --unsafe-perm --legacy-peer-deps --omit=dev + if ! npm install --unsafe-perm --legacy-peer-deps --omit=dev; then + return 1 + fi ;; yarn*) - yarn --production --frozen-lockfile --no-default-rc + if ! yarn --production --frozen-lockfile --no-default-rc; then + return 1 + fi ;; *) echo "Could not determine which package manager is being used to install code-server" exit 1 ;; esac + return 0 } vscode_install() { echo 'Installing Code dependencies...' cd lib/vscode - install_with_yarn_or_npm + if ! install_with_yarn_or_npm; then + return 1 + fi symlink_asar symlink_bin_script remote-cli code code-server symlink_bin_script helpers browser browser .sh cd extensions - install_with_yarn_or_npm + if ! install_with_yarn_or_npm; then + return 1 + fi + + return 0 } main "$@"