blob: eec27369553ce0c990e8e7ef1ef6fd4bab1c98c4 (
plain)
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
|
#!/usr/bin/env bash
action() {
local OPTIND
local clean_source
while getopts ":s" opt
do
case "$opt" in
s) clean_src=1 ;;
*) emerg "Invalid option specified: $opt" ;;
esac
done
shift $(( OPTIND - 1 ))
shopt -s extglob
rm -fr -- "!($BASEDIR/bin/rstar)"
rm -fr -- "$BASEDIR/dist"
rm -fr -- "$BASEDIR/include"
rm -fr -- "$BASEDIR/lib/libmoar.so"
rm -fr -- "$BASEDIR/share"
# Cleaning the sources is not desired for end-users, but convenient for
# maintainers. As such, this one is put behind an opt.
if [[ $clean_src ]]
then
rm -fr -- "$BASEDIR/src"
rm -f -- "$BASEDIR/etc/epoch.txt"
fi
}
|