diff --git a/misc/tools.func b/misc/tools.func index 7add0207..f07a0433 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -917,7 +917,13 @@ function fetch_and_deploy_gh_release() { fi $STD unzip "$tmpdir/$filename" -d "$target" elif [[ "$filename" == *.tar.* ]]; then - tar -xf "$tmpdir/$filename" -C "$target" + tar -xf "$tmpdir/$filename" -C "$tmpdir" + 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 msg_error "Unsupported archive format: $filename" rm -rf "$tmpdir"