Turn off Electron asar archive support.#628
Conversation
ShellJS fails to remove asar archives when run in Electron due to Electron fs patches that treat asar archives as virtual directories. See issue shelljs#618. To overcome this, we set process.noAsar to true.
|
@tgds Thanks for the patch. I agree that electron support is something we need to work on, and I'd like to move toward that in future releases. From the looks of it, this seems like something end users might prefer to do on their own. I have reservations about modifying globals, especially since ShellJS is often used with other packages. This has led in the past to some hard-to-find bugs. Although we're resetting noAsar's value here, it's still not a total perfect reset, since things subtly change (fails > // in regular node
> 'noAsar' in process
false
> var noAsar = process.noAsar
undefined
> process.noAsar = noAsar
undefined
> 'noAsar' in process // this value has changed, which end users might not expect
trueEven if we perfectly restore the state, there's always a chance that In the interest of kicking off support for electron, what if we instead document this in a new ShellJS wiki page, specifically for electron issues? That way ShellJS users know what to do and won't be surprised if this change breaks some other behavior. |
|
@nfischer Yeah, certainly doesn't feel like the cleanest solution. Very much appreciate your feedback, I still need to develop the sense of knowing what one can safely afford to do. |
|
Is there a reason why requiring users to use Using Are there any scenarios where |
|
@tgds I started this wiki page for documenting electron support. I think I can hack something out pretty quickly to expose a workaround for Depending on how difficult electron support is, this may be slated for our v0.8 or v0.9 release, but we should probably stick with reasonable workarounds at least until then. |
|
Closing, for the reasons noted in #618. We can reopen if documentation isn't sufficient. |
ShellJS fails to remove asar archives when run in Electron due to
Electron fs patches that treat asar archives as virtual directories.
See issue #618 .
To overcome this, we set process.noAsar to true.