3
# Save beam files in a directory if this script is called without argument.
4
# If -r (restore) is given, then all the beam files are removed and old
5
# beam files are restored.
8
PRESERVED=../preserved.tar.gz
11
if [ ! -f $PRESERVED ]; then
12
echo "Preserving beam files in $PRESERVED"
13
find . -type f -name \*.beam -print | xargs tar zcf $PRESERVED
15
echo "Beam files already preserved in $PRESERVED"
20
if [ ! -f $PRESERVED ]; then
21
echo "Warning: unable to restore beam files from $PRESERVED"
23
echo "Removing potentially bogus beam files"
24
find . -type f -name \*.beam -exec rm {} \;
25
echo "Restoring original beam files"
31
if [ "x$1" = x-r ]; then