vscode: preserve permissions of unpacked ASAR files

This commit is contained in:
Emin
2026-10-13 15:04:47 +08:00
committed by John Titor
parent a047d8209e
commit 7ac19a64ea

View File

@@ -414,6 +414,13 @@ stdenv.mkDerivation (
packed="resources/app/node_modules.asar"
unpacked="resources/app/node_modules"
asar extract "$packed" "$unpacked"
# FIXME: drop this when `asar extract` preserves the mode of unpacked files in
# the archives Microsoft ships, fixes https://github.com/NixOS/nixpkgs/issues/573021
if [ -d "$packed.unpacked" ]; then
cp -a "$packed.unpacked/." "$unpacked/"
fi
substituteInPlace $unpacked/@vscode/sudo-prompt/index.js \
--replace-fail "/usr/bin/pkexec" "/run/wrappers/bin/pkexec" \
--replace-fail "/bin/bash" "${bash}/bin/bash"