summaryrefslogtreecommitdiff
path: root/plugins/vscode/vscode.plugin.zsh
diff options
context:
space:
mode:
authorBabak K. Shandiz <babak.k.shandiz@gmail.com>2020-01-29 16:21:40 +0330
committerGitHub <noreply@github.com>2020-01-29 13:51:40 +0100
commit7ff77120c17b83ca1c5d4939d21c1a84a4b2ffbb (patch)
tree53f9d3dda50c86e97c214e66de5e9a3fa7edb7f9 /plugins/vscode/vscode.plugin.zsh
parent64a7f6b38833d007394b9b4bf5d17e48db77c0d7 (diff)
downloadzsh-7ff77120c17b83ca1c5d4939d21c1a84a4b2ffbb.tar.gz
zsh-7ff77120c17b83ca1c5d4939d21c1a84a4b2ffbb.tar.bz2
zsh-7ff77120c17b83ca1c5d4939d21c1a84a4b2ffbb.zip
vscode: use insiders build if stable not found (#8568)
* 🔨 Add calling VS Code Insiders * ✏️ Update README.md
Diffstat (limited to 'plugins/vscode/vscode.plugin.zsh')
-rw-r--r--plugins/vscode/vscode.plugin.zsh14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh
index 4c15df2b0..0144e0baa 100644
--- a/plugins/vscode/vscode.plugin.zsh
+++ b/plugins/vscode/vscode.plugin.zsh
@@ -1,9 +1,17 @@
# VScode zsh plugin
-# author: https://github.com/MarsiBarsi
+# Authors:
+# https://github.com/MarsiBarsi (original author)
+# https://github.com/babakks
-# Use main Visual Studio Code version by default
-: ${VSCODE:=code}
+# Use the stable VS Code release, unless the Insiders version is the only
+# available installation
+if ! which code > /dev/null && which code-insiders > /dev/null; then
+ : ${VSCODE:=code-insiders}
+else
+ : ${VSCODE:=code}
+fi
+# Define aliases
alias vsc="$VSCODE ."
alias vsca="$VSCODE --add"
alias vscd="$VSCODE --diff"