-
Notifications
You must be signed in to change notification settings - Fork 4
/
clean.sh
executable file
·42 lines (34 loc) · 901 Bytes
/
clean.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
38
39
40
41
42
#!/usr/bin/env bash
all=false
read -d '' docstring <<EOF
Usage:
clean.sh [( -a | --all )]
clean.sh ( -h | --help )
clean.sh ( --version )
Options:
-a, --all Delete all files, including results
-h, --help Show this help message and exits.
--version Print version and copyright information.
----
clean.sh 0.1.0
copyright (c) 2016 Cristian Consonni
MIT License
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
eval "$(echo "$docstring" | docopts -V - -h - : "$@" )"
# bash strict mode
# See:
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
rm -rfv output_dir
rm -fv books*_sublist.tsv*
rm -fv results*_sublist.tsv*
rm -rfv debug
rm -fv united
rm -fv ./*.booklist_cache.json
if $all; then
rm -fv results_tot.tsv
rm -fv index.html
fi