Skip to content

Commit 87581bb

Browse files
committed
build-release: only zip files, not directories
Zip format does not require to store directory to store files in a directory. Storing directory is only required for storing directory metadata (like file modification date, etc.) Not storing directories produces smaller zip files, the directories are automatically created when unzipping the files.
1 parent 9b927b7 commit 87581bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build-release

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ package () {
238238
rm -v "${archive_filename}"
239239
fi
240240

241-
7z -mx='9' -t"${archive_format}" a "${archive_filename}" .
241+
# Only store files, not folders, folders will be recreated on extraction.
242+
local file_list="$(mktemp)"
243+
find . -type f -printf '%P\n' | sort > "${file_list}"
244+
7z -mx='9' -t"${archive_format}" a "${archive_filename}" -i@"${file_list}"
245+
rm "${file_list}"
242246
)
243247
}
244248

0 commit comments

Comments
 (0)