Update tools.func

This commit is contained in:
CanbiZ 2025-07-03 15:13:34 +02:00
parent c2fd842fbc
commit 4eee9f8187

View File

@ -917,13 +917,7 @@ function fetch_and_deploy_gh_release() {
fi fi
$STD unzip "$tmpdir/$filename" -d "$target" $STD unzip "$tmpdir/$filename" -d "$target"
elif [[ "$filename" == *.tar.* ]]; then elif [[ "$filename" == *.tar.* ]]; then
tar -xf "$tmpdir/$filename" -C "$tmpdir" tar --strip-components=1 -xf "$tmpdir/$filename" -C "$target"
local unpack_dir
unpack_dir=$(find "$tmpdir" -mindepth 1 -maxdepth 1 -type d | head -n1)
shopt -s dotglob nullglob
cp -r "$unpack_dir"/* "$target/"
shopt -u dotglob nullglob
else else
msg_error "Unsupported archive format: $filename" msg_error "Unsupported archive format: $filename"
rm -rf "$tmpdir" rm -rf "$tmpdir"