packager: --asar-unpack not working due to invalid glob syntax
I am trying to bundle an electron app that uses the node-notifier module. In order to get the node-notifier module to work, it has to be unpacked when doing asar. I have tried to use both asar-unpack and asar-unpack-dir to get it to work, but neither seems to be working.
The call I am trying to use is ./node_modules/electron-packager/cli.js . MyApp --platform=darwin --arch=x64 --version=0.36.0 --asar=true --asar-unpack="./node_modules/node-notifier/vendor/**" --overwrite --out dist/and it is working 100% as expected except for the unpacking.
However, running asar pack . app.asar --unpack "./node_modules/node-notifier/vendor/**" does work. I can even then replace the app.asar that electron-packager creates in the Resources folder (along with adding the app.asar.unpacked folder) and everything works as expected.
This is occurring in version 5.2.0 of electron-packager.
There are no errors that I can see that are shown when I try to use the unpack parameter. Everything seems to work fine, except that there is no app.asar.unpacked directory created within the electron app.
Steps to reproduce:
- Run
./node_modules/electron-packager/cli.js . MyApp --platform=darwin --arch=x64 --version=0.36.0 --asar=true --asar-unpack="./node_modules/node-notifier/vendor/**" --overwrite --out dist/on an electron app - Navigate to
./dist/MyApp-darwin-x64/MyApp.app/Contents/Resources - Notice that
app.asarhas been created, butapp.asar.unpackedhas not been.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 1
- Comments: 17 (6 by maintainers)
It seems like itβs because asar uses absolute paths. This works:
@stormageddon Just solved exactly this issue β all you need to do is remove the β./β in the node-notifier path, i.e.
--asar-unpack="node_modules/node-notifier/vendor/**"not
--asar-unpack="./node_modules/node-notifier/vendor/**"