Skip to content

Commit fce1991

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 ec564ff commit fce1991

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
@@ -241,7 +241,11 @@ package () {
241241
rm -v "${archive_filename}"
242242
fi
243243

244-
7z -mx='9' -t"${archive_format}" a "${archive_filename}" .
244+
# Only store files, not folders, folders will be recreated on extraction.
245+
local file_list="$(mktemp)"
246+
find . -type f | cut -c3- | sort > "${file_list}"
247+
7z -mx='9' -snl -t"${archive_format}" a "${archive_filename}" -i@"${file_list}"
248+
rm "${file_list}"
245249
)
246250
}
247251

0 commit comments

Comments
 (0)