From 61c291ae4ef1870555a95826b9d0f0cfdcc20a80 Mon Sep 17 00:00:00 2001 From: aspro-at <58509503+aspro-at@users.noreply.github.com> Date: Wed, 23 Dec 2020 20:25:14 +0100 Subject: [PATCH] Fixed REMOVE_OLD_MODS with missing /data/mods or /data/plugins #667 (#697) --- start-finalSetupModpack | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/start-finalSetupModpack b/start-finalSetupModpack index 7cfabefc..4b955e27 100644 --- a/start-finalSetupModpack +++ b/start-finalSetupModpack @@ -19,8 +19,13 @@ if isTrue ${REMOVE_OLD_MODS}; then ;; esac - log "Removing old mods in $remove_mods_dest..." - find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete + # only try to remove existing mods dir + if [ -d "$remove_mods_dest" ]; then + log "Removing old mods in $remove_mods_dest..." + find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete + else + log "Directory $remove_mods_dest does not exist; removing nothing." + fi fi # If supplied with a URL for a modpack (simple zip of jars), download it and unpack