Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "--unpack" option for "pack" command #25

Merged
merged 4 commits into from
Mar 21, 2015
Merged

Add "--unpack" option for "pack" command #25

merged 4 commits into from
Mar 21, 2015

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Mar 20, 2015

The --unpack option can be used to filter out files that should not be packed into the .asar archives but will also be used by apps. The unpacked files will be put under .asar.unpacked folder, and that folder should be shipped together with .asar archive.

This requires changes in atom-shell to work.

Why

In Node under some cases we can only operate on real files instead of files packed in one archive, examples are fs.open, child_process.execFile, and process.dlopen which is used to load native modules. Our current implementation will first copy out the file to filesystem, and then pass it to those APIs, by introducing --unpack option we can eliminate the extra copy.

And it also solves the problem that some virus scanners would alert when we copy shared libraries from asar archives to filesystem (electron/electron#1205).

Example

$ asar pack input output.asar --unpack *.node
$ ls
output.asar
output.asar.unpacked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant