Skip to content

Instantly share code, notes, and snippets.

@shikanime
Created May 4, 2022 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shikanime/54c3c3c72946f8bc38eba39e531653cc to your computer and use it in GitHub Desktop.
Save shikanime/54c3c3c72946f8bc38eba39e531653cc to your computer and use it in GitHub Desktop.
Fix VSCode Server
#! /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 "/etc/profiles/per-user/devas/bin/node" nodepath
echo ("Fixed " <> repr subdir)
else do
echo ("Already fixed " <> repr subdir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment