-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·61 lines (42 loc) · 1.31 KB
/
install.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
#!/bin/bash
# Function to install dependencies
install_dependencies() {
echo "Installing dependencies..."
sudo apt-get update
sudo apt-get install -y zenity notify-osd
}
# Function to add scripts to .bashrc
add_to_bashrc() {
echo "Adding programmingHabits to .bashrc..."
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
MAIN_SCRIPT="$SCRIPT_DIR/scripts/main.sh"
REMINDERS_SCRIPT="$SCRIPT_DIR/scripts/reminders.sh"
# Check if the entries already exist in .bashrc
if ! grep -q "bash $MAIN_SCRIPT &" ~/.bashrc; then
echo "bash $MAIN_SCRIPT &" >> ~/.bashrc
fi
if ! grep -q "bash $REMINDERS_SCRIPT &" ~/.bashrc; then
echo "bash $REMINDERS_SCRIPT &" >> ~/.bashrc
fi
source ~/.bashrc
}
# Function to set up the project
setup_project() {
echo "Setting up programmingHabits project..."
# Create the logs directory if it doesn't exist
mkdir -p logs
# Touch the session log file
touch logs/session.log
# Copy the example settings file to the config directory if it doesn't exist
if [ ! -f config/settings.conf ]; then
cp config/settings.conf.example config/settings.conf
fi
echo "Project setup complete."
}
main() {
install_dependencies
setup_project
# add_to_bashrc
echo "Installation complete!"
}
main