add scripts for vscode server
This commit is contained in:
12
scripts/fix-vscode-node
Executable file
12
scripts/fix-vscode-node
Executable file
@@ -0,0 +1,12 @@
|
||||
#! /bin/sh
|
||||
# fix-vscode-server-node.sh
|
||||
# https://github.com/microsoft/vscode-remote-release/issues/648#issuecomment-503148523
|
||||
cd ~/.vscode-server/bin/*
|
||||
if ! ./node -e "require('process').exit(0)"
|
||||
then
|
||||
echo patching node binary $(readlink -f node)
|
||||
rm node
|
||||
ln -s $(which node)
|
||||
else
|
||||
echo node is working $(readlink -f node)
|
||||
fi
|
||||
18
scripts/nix-vscode-server
Executable file
18
scripts/nix-vscode-server
Executable file
@@ -0,0 +1,18 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])"
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
import Turtle
|
||||
|
||||
main = sh $ do
|
||||
homedir <- home
|
||||
subdir <- ls $ homedir </> ".vscode-server/bin/"
|
||||
let nodepath = subdir </> "node"
|
||||
badnode <- isNotSymbolicLink nodepath
|
||||
if badnode
|
||||
then do
|
||||
mv nodepath (subdir </> "node_backup")
|
||||
symlink "/run/current-system/sw/bin/node" nodepath
|
||||
echo ("Fixed " <> repr subdir)
|
||||
else do
|
||||
echo ("Already fixed " <> repr subdir)
|
||||
Reference in New Issue
Block a user