Merge pull request #7479 from bpasero/process-no-asar

Introduce ELECTRON_NO_ASAR
This commit is contained in:
Kevin Sawicki 2016-10-12 13:48:03 -07:00 committed by GitHub
commit fefc7c23f9
4 changed files with 66 additions and 1 deletions

View file

@ -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]
}