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.
This commit is contained in:
Asher 2023-09-11 09:18:25 -08:00
parent 3e1c00e017
commit 03dc8cd808
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 15 additions and 4 deletions

View File

@ -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 "$@"