-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.sh
36 lines (32 loc) · 821 Bytes
/
code.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# What it does?
#
# Open your project in preferred text editor and cd into project's directory
read -p "Enter project name: " PROJECT_NAME
read -p "Enter project's path: " PROJECT_PATH
echo "Select your editor: "
# Open project in VS Code and Run the development server
options=("VS Code" "VS Code Insiders")
select PROJECT_EDITOR in "${options[@]}"
do
case $PROJECT_EDITOR in
"VS Code")
echo "Opening ${PROJECT_NAME} in VS Code"
code ${PROJECT_PATH}
cd ${PROJECT_PATH}
exec bash
break
;;
"VS Code Insiders")
echo "Opening ${PROJECT_NAME} in VS Code Insiders"
code-insiders ${PROJECT_PATH}
cd ${PROJECT_PATH}
exec bash
break
;;
*)
echo "Please provide an input for text editor."
break
;;
esac
done