From aa9d02670b13b02a07f97f8b635c8d69aa539d57 Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 29 Nov 2020 21:43:52 -0600 Subject: [PATCH] Forgot to add the cleanup function --- gentoostrap.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gentoostrap.sh b/gentoostrap.sh index 039fa54..88e6bbe 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -65,6 +65,12 @@ has() { return 0 } +# Helper functions +cleanup() { + [ -z "$1" ] && warn "No argument passed to cleanup" + rm -rf "$1" || warn "Failed to remove $1: $?" +} + # Core program functions printhelp() { cat << EOF @@ -167,7 +173,7 @@ main() { # TODO: That # Validate core program dependencies 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 fi