Merge pull request #76492 from tbenst/remote-ssh-fix

vscode-extensions.ms-vscode-remote.remote-ssh: fix patch for 0.48.0
This commit is contained in:
Jörg Thalheim 2019-12-26 06:33:50 +00:00 committed by GitHub
commit 38c3a43c0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,21 +9,23 @@ let
inherit (vscode-utils) buildVscodeMarketplaceExtension;
# patch runs on remote machine hence use of which
# links to local node if version is 12
patch = ''
f="/home/''$USER/.vscode-server/bin/''$COMMIT_ID/node"
nodePath=''$(which node)
if [ -x "''$nodePath" ]; then
nodeVersion=''$(node -v)
if [[ "${nodeVersion:1:2}" == "12" ]]; then
echo PATCH: replacing ''$f with ''$nodePath
localNodePath=''$(which node)
if [ -x "''$localNodePath" ]; then
localNodeVersion=''$(node -v)
if [ "\''${localNodeVersion:1:2}" = "12" ]; then
echo PATCH: replacing ''$f with ''$localNodePath
rm ''$f
ln -s ''$nodePath ''$f
ln -s ''$localNodePath ''$f
fi
fi
${stdenv.lib.optionalString useLocalExtensions ''
# Use local extensions
if test -f "~/.vscode/extensions"; then
if [ -d ~/.vscode/extensions ]; then
if ! test -L "~/.vscode-server/extensions"; then
mkdir -p ~/.vscode-server
ln -s ~/.vscode/extensions ~/.vscode-server/
fi
fi