-
Notifications
You must be signed in to change notification settings - Fork 112
Description
Feature request: A command line argument such as --include-files that operates similar to --urls-file, reading a text file containing a list of file or directory paths (separated by a newline) to save inside the root of a self-extracting ZIP.
Justification: While it is technically possible to update a single-file-cli created self-extracting ZIP polyglot file using a couple ZIP archive tools (such as Ark in Linux), doing so subsequently breaks Chrome-based browsers due to the same-origin policy issue. Firefox can still open the file, indicating only the method where data is read directly from the DOM is impacted. I was unable to identify the precise corruption point when comparing files before and after additions (even ones the same number of bytes long).
As discussed in other issues and threads, it's probably best to not allow the ZIP file to be changed after creation, to the point where setting the native OS read-only flag on created files might be beneficial. Since updating the ZIP is unlikely to work, it would be helpful to have some mechanism to include additional files in the ZIP archive at the time of initial creation instead.
Background: I am creating reports in Obsidian, a Markdown editor that can export HTML files using the Webpage HTML Export plugin. I need single-file-cli to create a polyglot with that standalone, offline .html file and include the original text .md files used to create the report within the polyglot ZIP. (As an aside, I also need the polyglot file to contain other binary artifacts including the .PDF file generated by the Obsidian Better PDF Export plugin; the --embed-plugin feature doesn't create a PDF with clickable anchor links or an outline and the --embedded-pdf option silently fails to add PDF version 1.7 files such as the ones from the Obsidian Better PDF Export plugin.)
I've attempted to look through the source code and all issues and discussions from all related repositories looking for clues on how to achieve this and haven't found a way yet but I'll continue to explore workarounds on my side. I've prepared sample files if you'd like them for testing. Thanks in advance for your consideration and/or aid!