Skip to content

Instantly share code, notes, and snippets.

@gerrard00
Last active February 26, 2019 19:24
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 gerrard00/ca5f36b45629d82c61e2ba6296ca4f3d to your computer and use it in GitHub Desktop.
Save gerrard00/ca5f36b45629d82c61e2ba6296ca4f3d to your computer and use it in GitHub Desktop.
Update Visual Studio Code launch.json file to use current version of node from NVM
node_path="$(which node)"
temp_file=$(mktemp /tmp/launch-$$.json)
grep -v '^\s*//' < .vscode/launch.json | jq '.configurations[].runtimeExecutable = "'$node_path'"' > $temp_file
mv .vscode/launch.json .vscode/launch.json.bak
mv $temp_file .vscode/launch.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment