Update tools.func

This commit is contained in:
CanbiZ 2025-07-07 10:00:33 +02:00
parent 5a7ed724df
commit 79d3bdbcef

View File

@ -931,7 +931,11 @@ 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 --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 else
msg_error "Unsupported archive format: $filename" msg_error "Unsupported archive format: $filename"
rm -rf "$tmpdir" rm -rf "$tmpdir"