Skip to content

Instantly share code, notes, and snippets.

@343max
Last active September 16, 2020 14:45
Show Gist options
  • Save 343max/345160cf1a1367bcb7545130cd200613 to your computer and use it in GitHub Desktop.
Save 343max/345160cf1a1367bcb7545130cd200613 to your computer and use it in GitHub Desktop.
for all those people who use VSCode Insiders normally to switch very quickly to the stable version when needed just by launching VSCode stable
#!/usr/bin/env bash
# use VSCode Insiders by default, but not if VSCode Stable is already running
# [V] is neccessary so grep doesn't find itself...
VS_IS_RUNNING=$(ps -A | grep "/[V]isual Studio Code.app/Contents/MacOS/Electron" | wc -l)
if [ $VS_IS_RUNNING -ne 0 ]; then
/usr/local/bin/code "$@"
else
/usr/local/bin/code-insiders "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment