diff --git a/monujo/lib/common b/monujo/lib/common index 35c6906..5f61fa7 100644 --- a/monujo/lib/common +++ b/monujo/lib/common @@ -18,8 +18,11 @@ monujo:code_init() { return 0 fi fi - [ -d "$LOCATION" ] && rm -rf "$LOCATION" - mkdir -p "$LOCATION" + if [ -d "$LOCATION" ]; then + find "$LOCATION" -mindepth 1 -delete + else + mkdir -p "$LOCATION" + fi cd "$LOCATION" info "Downloading '$SOURCE_URL'." wget -q "$SOURCE_URL" -O file.tar.bz2 || {