Created
May 4, 2022 12:45
-
-
Save shikanime/54c3c3c72946f8bc38eba39e531653cc to your computer and use it in GitHub Desktop.
Fix VSCode Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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