From 589a9aa3dbd936edc0c81e9f6117c9c035d2e4ac Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 12 May 2021 20:41:28 -0500 Subject: [PATCH] Added support for directories in MODS #871 --- README.md | 8 +++++--- start-finalSetupModpack | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d29f6c3..9e273033 100644 --- a/README.md +++ b/README.md @@ -1136,10 +1136,12 @@ To use this option pass the environment variable `MODPACK`, such as top level of the zip archive. Make sure the jars are compatible with the particular `TYPE` of server you are running. -You may also download individual mods using the `MODS` environment variable and supplying the URL or path -to the jar files. Multiple mods/plugins should be comma separated. +You may also download or copy over individual mods using the `MODS` environment variable. `MODS` contains a comma-separated list of +- URL of a jar file +- container path to a jar file +- container path to a directory containing jar files - docker run -d -e MODS=https://www.example.com/mods/mod1.jar,https://www.example.com/mods/mod2.jar ... + docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ... ### Remove old mods/plugins diff --git a/start-finalSetupModpack b/start-finalSetupModpack index c854ebb7..4e956070 100644 --- a/start-finalSetupModpack +++ b/start-finalSetupModpack @@ -91,15 +91,18 @@ if [[ "$MODS" ]]; then exit 2 fi fi - elif [[ "$i" =~ .*\.jar ]]; then + elif [[ -f "$i" && "$i" =~ .*\.jar ]]; then log "Copying plugin located at $i ..." out_file=$(basename "$i") if ! cp "$i" "${out_dir}/$out_file"; then log "ERROR: failed to copy from $i into $out_dir" exit 2 fi + elif [[ -d "$i" ]]; then + log "Copying plugin jars from $i ..." + cp "$i"/*.jar "${out_dir}" else - log "ERROR Invalid URL or Path given in MODS: $i" + log "ERROR Invalid URL or path given in MODS: $i" exit 2 fi done