-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·38 lines (30 loc) · 978 Bytes
/
update.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
#!/bin/sh
set -euo pipefail
# when editing, reflect changes in `update.cmd`, too!
if [ ! -d "MathHub" ]; then
echo "this script needs to be executed in the archives repository"
exit 1
fi
# warn before deleting uncommitted changes
while true; do
read -p "This will delete all your uncommitted changes and update to the version that is committed in the archives repository, do you want to continue? [y,n]: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit 2;;
* ) echo "Please answer yes or no.";;
esac
done
# echo commands
set -x
./clean-git.sh -y
git pull
# init submodules in case they haven't been cloned yet
# and update them to the version that is committed in the archives repository
git submodule update --init
./clean-git.sh -y
#git submodule foreach git checkout devel
#git submodule foreach git pull
# echo off
set +x
# wait for user input to let the user see if there were any errors
read -p "Press enter to continue" ENTER