TeaWeb/scripts/cleanup.sh

25 lines
512 B
Bash
Raw Normal View History

2019-02-25 14:59:42 +00:00
#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
cd "$BASEDIR/../"
# This script cleanups all generated files
function remove_if_exists() {
if [[ -f "$1" ]] || [[ -d "$1" ]]; then
echo "Deleting $1"
rm -r "$1"
fi
}
function cleanup_declarations() {
remove_if_exists shared/declarations/
remove_if_exists web/declarations/
}
function cleanup_generated_files() {
remove_if_exists shared/generated
remove_if_exists web/generated
}
cleanup_declarations
cleanup_generated_files