Merge pull request #7479 from bpasero/process-no-asar
Introduce ELECTRON_NO_ASAR
This commit is contained in:
commit
fefc7c23f9
4 changed files with 66 additions and 1 deletions
|
@ -10,6 +10,16 @@
|
|||
// Cache asar archive objects.
|
||||
const cachedArchives = {}
|
||||
|
||||
const isAsarDisabled = function () {
|
||||
if (process.noAsar) {
|
||||
return true
|
||||
}
|
||||
if (process.env.ELECTRON_NO_ASAR && process.type !== 'browser' && process.type !== 'renderer') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const getOrCreateArchive = function (p) {
|
||||
let archive = cachedArchives[p]
|
||||
if (archive != null) {
|
||||
|
@ -34,7 +44,7 @@
|
|||
// Separate asar package's path from full path.
|
||||
const splitPath = function (p) {
|
||||
// shortcut to disable asar.
|
||||
if (process.noAsar) {
|
||||
if (isAsarDisabled()) {
|
||||
return [false]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue