Skip to content

Commit 85f8afb

Browse files
committed
feat: --wipe
1 parent 34c4716 commit 85f8afb

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

build-coatjava.sh

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ DATA RETRIEVAL OPTIONS
3838
--lfs use Git Large File Storage (requires `git-lfs`)
3939
--cvmfs use CernVM-FS (requires `/cvfms`)
4040
--clasweb use clasweb (only works for field maps)
41-
Options to disable data retrieval:
41+
Additional options
4242
--nomaps do not download/overwrite field maps
4343
--nonets do not download/overwrite neural networks
44+
--wipe remove retrieved data
4445
4546
TESTING OPTIONS
4647
--spotbugs also run spotbugs plugin
@@ -81,9 +82,13 @@ do
8182
--cvmfs) dataRetrieval=cvmfs ;;
8283
--lfs) dataRetrieval=lfs ;;
8384
--clasweb) dataRetrieval=clasweb ;;
84-
--xrootd) dataRetrieval=xrootd ;;
85+
--wipe) dataRetrieval=wipe ;;
8586
--clara) installClara=true ;;
8687
--data) downloadData=true ;;
88+
--xrootd)
89+
echo "ERROR: option \`$xx\` is deprecated; use \`--help\` for guidance" >&2
90+
exit 1
91+
;;
8792
-h|--help)
8893
echo "$usage"
8994
exit 2
@@ -130,14 +135,17 @@ if $cleanBuild; then
130135
for target_dir in $(find $src_dir -type d -name target); do
131136
echo "WARNING: target directory '$target_dir' was not removed! JAR files within may be accidentally installed!" >&2
132137
done
133-
echo """DONE CLEANING.
134-
NOTE:
135-
- to remove local magnetic field maps:
136-
rm $magfield_dir/*.dat
137-
- to clear all LFS git submodules:
138-
git submodule deinit --all
139-
140-
Now re-run without \`--clean\` to build."""
138+
fi
139+
140+
# wipe retrieved data (field maps, NN models, etc.)
141+
if [ "$dataRetrieval" = "wipe" ]; then
142+
git submodule deinit --all --force
143+
fi
144+
145+
# print cleanup note and exit
146+
if $cleanBuild || [ "$dataRetrieval" = "wipe" ]; then
147+
[ "$dataRetrieval" = "wipe" ] && echo "[+] REMOVED RETRIEVED DATA" || echo "[+] NOTE: retrieved data not removed; use \`--wipe\` if you need to remove them"
148+
$cleanBuild && echo "[+] DONE CLEANING; rerun without \`--clean\` to build"
141149
exit
142150
fi
143151

0 commit comments

Comments
 (0)