Archived
1
0

Merge pull request #2482 from cdr/asar

Symlink node_modules.asar to node_modules in lib/vscode
This commit is contained in:
Asher
2020-12-18 10:54:36 -08:00
committed by GitHub
7 changed files with 52 additions and 4 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
pushd() {
builtin pushd "$@" > /dev/null
@ -93,3 +94,22 @@ export OS
# RELEASE_PATH is the destination directory for the release from the root.
# Defaults to release
RELEASE_PATH="${RELEASE_PATH-release}"
# VS Code bundles some modules into an asar which is an archive format that
# works like tar. It then seems to get unpacked into node_modules.asar.
#
# I don't know why they do this but all the dependencies they bundle already
# exist in node_modules so just symlink it. We have to do this since not only VS
# Code itself but also extensions will look specifically in this directory for
# files (like the ripgrep binary or the oniguruma wasm).
symlink_asar() {
if [ ! -e node_modules.asar ]; then
if [ "${WINDIR-}" ]; then
# mklink takes the link name first.
mklink /J node_modules.asar node_modules
else
# ln takes the link name second.
ln -s node_modules node_modules.asar
fi
fi
}