-
Notifications
You must be signed in to change notification settings - Fork 0
/
push_config.sh
executable file
·53 lines (42 loc) · 1.17 KB
/
push_config.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
#!/bin/bash
CONFIG_PATH=/home/eran/.config
SCRIPT_PATH=/home/eran/scripts
cd $CONFIG_PATH
if [ -d ".git" ]; then
echo "Directory is already initialized with git."
else
echo "Directory is not initialized with git."
git init
git branch -M main
git config pull.rebase false
git branch --set-upstream-to=origin/main main
git remote add origin [email protected]:eboody/dotfiles
fi
# Define an array of file names
file_names=(
"$CONFIG_PATH/hypr"
"$CONFIG_PATH/tmux"
"$CONFIG_PATH/kitty"
"$CONFIG_PATH/nvim"
"$CONFIG_PATH/rsync_exclude.txt"
"$CONFIG_PATH/starship.toml"
"$CONFIG_PATH/waybar"
"$CONFIG_PATH/rofi"
"$CONFIG_PATH/qutebrowser"
)
# Add each file to git
for file_name in "${file_names[@]}"; do
git add "$file_name"
done
# Remove tmux/plugins directory from Git index
git rm --cached -r -f "$CONFIG_PATH/tmux/plugins"
# Commit with current date and time as message
commit_message="Update: $(date +'%Y-%m-%d %H:%M:%S')"
git commit -m "$commit_message"
# Push to your GitHub repository
git push -f origin main
cd $SCRIPT_PATH
git add .
commit_message="Update: $(date +'%Y-%m-%d %H:%M:%S')"
git commit -m "$commit_message"
git push origin main