-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_project.sh
executable file
·83 lines (68 loc) · 1.67 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
menu(){
echo "choose the project type to create a project"
echo "1. Python"
echo "2. Bash"
echo "3. Exit"
}
create_python() {
read -p "Enter the project name: " project
# Create the project directory
mkdir -p "$project"
cd "$project" || exit
# Create a Python file
touch main.py
echo "Python project setup completed"
# Set up a virtual env
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Generate README with Python-specific instructions
cat << EOF > README.md
# Project: $project_name
## General Setup Guide
1. Clone the project repository.
2. [Add any additional setup steps here.]
## Running the Python Project
To run the Python project, follow these steps:
1. Run the main Python file:
\`\`\`bash
python main.py
\`\`\`
EOF
}
create_bash() {
read -p "Enter the project name: " project
# Create the project directory
mkdir -p "$project"
cd "$project" || exit
# Create a bash file
touch main.sh
echo" Bash project setup completed"
# Generate README with Bash-specific instructions
cat << EOF > README.md
# Project: $project_name
## General Setup Guide
1. Clone the project repository.
2. [Add any additional setup steps here.]
## Running the Bash Project
To run the Bash project, follow these steps:
1. Make the main Bash file executable:
\`\`\`bash
chmod +x main.sh
2. Run the main Bash file:
./main.sh
EOF
}
menu
read -p "choose from the menu above(number): " choice
case $choice in
1)
create_python
;;
2)
create_bash
;;
3)
exit;;
esac