-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgravity
92 lines (78 loc) · 2.27 KB
/
gravity
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
84
85
86
87
88
89
90
91
92
#!/bin/bash
#Author: Atharva Tilewale
#Add miniconda to PATH
export PATH="$HOME/miniconda3/bin:$PATH"
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bashrc
conda init bash
source ~/.bashrc
# Ensure the current shell recognizes Conda
eval "$(conda shell.bash hook)"
conda activate gravity_env
#Change working directory
cd $HOME/.GRAVITy
new_project() {
echo "\nStarting a new project..."
mkdir -p projects/$(date +%Y%m%d_%H%M%S)_new_project
echo "New project created in the 'projects' directory."
}
open_project() {
echo "\nAvailable projects:"
projects=(projects/*)
if [ ${#projects[@]} -eq 0 ]; then
echo "No projects found."
return
fi
for i in "${!projects[@]}"; do
echo "$((i + 1))) ${projects[$i]##*/}"
done
read -p "Enter the number of the project to open: " project_number
if [[ $project_number -ge 1 && $project_number -le ${#projects[@]} ]]; then
project_name=${projects[$((project_number - 1))]}
echo "Opening project: ${project_name##*/}"
# Add additional commands to open the project
else
echo "Invalid selection. Returning to main menu."
fi
}
existing_reports() {
echo "\nExisting reports:"
ls reports
read -p "Enter the name of the report to view: " report_name
if [ -f "reports/$report_name" ]; then
cat reports/$report_name
else
echo "Report not found."
fi
}
check_for_updates() {
echo "\nChecking for updates..."
echo "Fetching updates from the repository..."
git pull
}
settings() {
echo "\nOpening settings..."
echo "1) Change default project directory"
echo "2) Update notification preferences"
echo "3) Back"
read -p "Enter your choice: " settings_choice
case $settings_choice in
1)
read -p "Enter new project directory path: " new_dir
echo "Default project directory changed to $new_dir"
;;
2)
echo "Update notification preferences coming soon."
;;
3)
main_menu
;;
*)
echo "Invalid choice. Returning to settings."
settings
;;
esac
}
# # Entry point
# mkdir -p projects reports
# main_menu
bash $HOME/.GRAVITy/simulate #run GRAVITy simulation