-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_project.sh
69 lines (49 loc) · 1.1 KB
/
init_project.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
while true; do
echo "Please enter the folder name (or 'quit' to exit):"
read folder_name
if [[ $folder_name == "quit" ]]; then
break
fi
if [[ -z $folder_name ]]; then
echo "Folder name cannot be empty"
continue
fi
mkdir ~/Desktop/$folder_name
echo "Folder '$folder_name' created on the Desktop'!"
echo "What is your project type?
1. python
2. bash
"
read response
#making a choice
case $response in
1)
#entering into the users folder
cd ~/Desktop/$folder_name
#installing python3 virtual env
pip install virtualenv
#creating a new virtual env
echo "what is the name of the virtual environment you want to creat"
read env_name
virtualenv $env_name
#activating the virtual environmet
source $env_name/bin/activate
;;
2)
cd ~/Desktop/$folder_name
touch README
;;
esac
#asking the user if he wants to carry out a new project.
echo "do you want to work on a new project (yes/no)?"
read answer
case $answer in
yes)
continue
;;
no)
break
;;
esac
done