tar globbing

This commit is contained in:
CanbiZ 2025-07-03 15:11:45 +02:00
parent 360bb5a458
commit c2fd842fbc

View File

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