--asar-unpack not working due to invalid glob syntax
See original GitHub issueI 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.asar
has been created, butapp.asar.unpacked
has not been.
Issue Analytics
- State:
- Created 8 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/**"