Skip to content
Permalink
93de43745e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 65 lines (55 sloc) 1.25 KB
#!/bin/bash
BASE_DIR=$(dirname $0)/..
SCRIPT_DIR=$(dirname $0)
INTERMEDIATE_DIR="$BASE_DIR/schema/intermediate"
#######################################
# functions
#######################################
function print_help {
echo "clean autogenerated intermediate files in '$INTERMEDIATE_DIR' (schemata, docu)"
echo
echo "usage: $0 [STAGE]"
echo
echo "(if no STAGE is given, cleans all stages)"
echo
echo "OPTIONS:"
echo " -h | --help: print this help"
echo
echo "ARGUMENTS:"
echo " STAGE: Clean all output in this stage including all later stage. Possible values: 0, 1, 2"
}
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h | --help)
print_help
exit 0
;;
-* )
echo "wrong syntax!"
print_help
exit 1
;;
*)
break
;;
esac
done
if [[ "$#" -gt "1" ]]; then
print_help
exit 1
fi
# rm -rfv $INTERMEDIATE_DIR/generated
if [[ "$1" == "" ]] || [[ "$1" == "0" ]]; then
echo "cleaning s0:"
rm -rfv $INTERMEDIATE_DIR/s0/generated
rm -rfv $INTERMEDIATE_DIR/s0/logs
fi
if [ "$1" == "" ] || [ "$1" == "0" ] || [ "$1" == "1" ]; then
echo "cleaning s1:"
rm -rfv $INTERMEDIATE_DIR/s1
fi
if [[ "$1" == "" ]] || [[ "$1" == "0" ]] || [[ "$1" == "1" ]] || [[ "$1" == "2" ]]; then
echo "cleaning s2:"
rm -rfv $INTERMEDIATE_DIR/s2
fi