Skip to content

Commit bff6a50

Browse files
committed
skip plugin download, when already installed and cleanup old versions
Signed-off-by: Pascal Sthamer <pascal.sthamer@ips-hosting.com>
1 parent 4e64777 commit bff6a50

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

hytale/entrypoint.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,28 @@ function install_default_plugins() {
142142
# Install a plugin by repo
143143
function _install_plugin_repo() {
144144
local repo="$1"
145+
local plugin_name
146+
plugin_name=$(basename "$repo")
147+
145148
local url
146149
url=$(_latest_jar_url "$repo")
147150
if [ -z "$url" ]; then
148151
echo "Warning: Could not find release JAR for $repo"
149152
return
150153
fi
154+
151155
local filename
152156
filename=$(basename "$url")
157+
158+
# Check if this exact version is already installed
159+
if [ -f "$mods_dir/$filename" ]; then
160+
echo "Plugin $filename already installed, skipping download"
161+
return
162+
fi
163+
164+
# Remove old versions of the plugin
165+
rm -fv "$mods_dir"/*"$plugin_name"*.jar
166+
153167
echo "Downloading $repo -> $filename"
154168
wget -O "$mods_dir/$filename" "$url"
155169
}

0 commit comments

Comments
 (0)