bin/open-editor: Added checks if VS Code is there

Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-02-22 19:23:32 +08:00
parent 8f9f37af76
commit ed6807c396
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
1 changed files with 13 additions and 0 deletions

13
bin/open-editor Executable file
View File

@ -0,0 +1,13 @@
#!/bin/env bash
VSCODE_PATH=$(command -v code)
NANO_PATH=$(command -v code)
VI_PATH=$(command -v code)
if [[ $VSCODE_PATH != "" ]]; then
code --wait $1
elif [[ $NANO_PATH != "" ]]; then
nano $1
else
vi $1
fi