bin/open-editor: Add some flags.

Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-02-22 19:26:52 +08:00
parent ed6807c396
commit e95919895e
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
1 changed files with 10 additions and 4 deletions

View File

@ -4,10 +4,16 @@ 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
if [[ $2 == "--use-nano" ]]; then
nano $1
elif [[ $2 == "--use-code" ]]; then
vscode --wait $1
else
vi $1
if [[ $VSCODE_PATH != "" ]]; then
code --wait $1
elif [[ $NANO_PATH != "" ]]; then
nano $1
else
vi $1
fi
fi