Skip to content

Commit

Permalink
splitted the clean script into two separate scripts. One for removing…
Browse files Browse the repository at this point in the history
… build artefacts and one for recursively resetting the git status.
  • Loading branch information
bessw committed Jul 17, 2024
1 parent ae504a0 commit e553a2a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#!/bin/sh
set -euxo pipefail

../MMT/deploy/run-file build.msl
#java -Xmx8192m -cp "../MMT/deploy/mmt.jar" info.kwarc.mmt.api.frontend.Run :file build.msl
18 changes: 18 additions & 0 deletions clean-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# this will remove your source code changes!
if [ "$1" != "-y" ]; then
while true; do
read -p "This will delete all your uncommitted changes, do you want to continue? [y,n]: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit 2;;
* ) echo "Please answer yes or no.";;
esac
done
fi

git submodule foreach "
git clean -fdx
git reset --hard
"
8 changes: 2 additions & 6 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/sh
git submodule foreach "
git clean -fdx
git reset --hard
"

echo
echo "Removing all commited build artefacts:"
# this only removes build artefacts and should not delete any source code changes (no gurantee)
echo "Removing all (commited and uncommited) build artefacts:"
find '(' -type d '(' -name "bin" -o -name "content" -o -name "errors" -o -name "narration" -o -name "relational" -o -name "logaux" ')' -o -type f -name "build.html" ')' -print -exec rm -r {} +
4 changes: 2 additions & 2 deletions update-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ done
# echo commands
set -x

./clean.sh
./clean-git.sh -y
git pull
# init submodules in case they haven't been cloned yet
# and update them to the latest remote commit
git submodule update --init --remote
./clean.sh
./clean-git.sh -y

#git submodule foreach git checkout devel
#git submodule foreach git pull
Expand Down
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ done
# echo commands
set -x

./clean.sh
./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.sh
./clean-git.sh -y

#git submodule foreach git checkout devel
#git submodule foreach git pull
Expand Down

0 comments on commit e553a2a

Please sign in to comment.