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