From 79d3bdbcefd95ce57822220140cdf698e2bda045 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 7 Jul 2025 10:00:33 +0200 Subject: [PATCH] Update tools.func --- misc/tools.func | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/tools.func b/misc/tools.func index 99db6d99..a69c95b1 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -931,7 +931,11 @@ function fetch_and_deploy_gh_release() { fi $STD unzip "$tmpdir/$filename" -d "$target" elif [[ "$filename" == *.tar.* ]]; then - tar --strip-components=1 -xf "$tmpdir/$filename" -C "$target" + if tar -tf "$tmpdir/$filename" | grep -qE '^([^/]+/){2}'; then + tar --strip-components=1 -xf "$tmpdir/$filename" -C "$target" + else + tar -xf "$tmpdir/$filename" -C "$target" + fi else msg_error "Unsupported archive format: $filename" rm -rf "$tmpdir"