Update tools.func

This commit is contained in:
CanbiZ 2025-06-17 09:02:02 +02:00
parent 7221b39759
commit 2c84379711

View File

@ -889,7 +889,18 @@ function fetch_and_deploy_gh_release() {
}
mkdir -p "$target"
[[ $filename == *.zip ]] && unzip "$tmpdir/$filename" -d "$target" || [[ $filename == *.tar.gz ]] && tar -xzf "$tmpdir/$filename" -C "$target"
if [[ "$filename" == *.zip ]]; then
if ! command -v unzip &>/dev/null; then
$STD apt-get install -y unzip
fi
unzip "$tmpdir/$filename" -d "$target"
elif [[ "$filename" == *.tar.gz ]]; then
tar -xzf "$tmpdir/$filename" -C "$target"
else
msg_error "Unsupported archive format: $filename"
rm -rf "$tmpdir"
return 1
fi
elif [[ "$mode" == "singlefile" ]]; then
local pattern="$6"