Forgot to add the cleanup function

This commit is contained in:
Salt 2020-11-29 21:43:52 -06:00
parent e9f7dab5e6
commit aa9d02670b

View File

@ -65,6 +65,12 @@ has() {
return 0 return 0
} }
# Helper functions
cleanup() {
[ -z "$1" ] && warn "No argument passed to cleanup"
rm -rf "$1" || warn "Failed to remove $1: $?"
}
# Core program functions # Core program functions
printhelp() { printhelp() {
cat << EOF cat << EOF
@ -167,7 +173,7 @@ main() {
# TODO: That # TODO: That
# Validate core program dependencies # Validate core program dependencies
log "Validating dependencies" 2 log "Validating dependencies" 2
if ! has basename curl tar; then if ! has basename curl systemd-nspawn tar; then
error "Failed to find program: $_return" 1 error "Failed to find program: $_return" 1
fi fi