forked from trypear/pearai-master
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_master_repo.sh
More file actions
executable file
·45 lines (36 loc) · 1.42 KB
/
setup_master_repo.sh
File metadata and controls
executable file
·45 lines (36 loc) · 1.42 KB
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
#!/bin/bash
# Add submodules
git submodule add https://github.com/trypear/pearai-app.git pearai-app
git submodule add https://github.com/trypear/pearai-submodule.git pearai-submodule
git submodule add https://github.com/trypear/pear-landing-page.git pear-landing-page
git submodule add https://github.com/trypear/pearai-documentation.git pearai-documentation
git submodule add https://github.com/trypear/pearai-server-issues-public.git pearai-server-issues-public
git submodule add https://github.com/trypear/pearai-server.git pearai-server
# Initial commit
git add .
git commit -m "Add submodules for all Pear AI repositories"
# Create a script for daily updates
cat << EOF > update_submodules.sh
#!/bin/bash
# Update all submodules
git submodule update --remote
# Check if there are changes
if [[ -n $(git status -s) ]]; then
# Commit and push changes
git add .
git commit -m "Daily update of submodules $(date +%Y-%m-%d)"
git push origin main
else
echo "No updates to submodules."
fi
EOF
# Make the update script executable
chmod +x update_submodules.sh
# Add the update script to the repository
git add update_submodules.sh
git commit -m "Add script for daily submodule updates"
# Push all changes to the remote repository
git push origin main
# Instructions for setting up a daily cron job
echo "To set up daily updates, add the following line to your crontab:"
echo "0 0 * * * cd /path/to/your/master-repo && ./update_submodules.sh"