From e51bda4fd0e351902eca5534451798a12c889bcd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 1 Apr 2016 17:27:37 -0700 Subject: [PATCH 1/2] Delete default_app.asar --- common.js | 4 ++++ test/basic.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common.js b/common.js index 755b5ef5..9bd246b3 100644 --- a/common.js +++ b/common.js @@ -111,7 +111,11 @@ module.exports = { fs.copy(opts.dir, appPath, {filter: userIgnoreFilter(opts), dereference: true}, cb) }, function (cb) { + // Support removing old default_app folder that is now an asar archive rimraf(path.join(resourcesPath, 'default_app'), cb) + }, + function (cb) { + rimraf(path.join(resourcesPath, 'default_app.asar'), cb) } ] diff --git a/test/basic.js b/test/basic.js index 0493afdf..2818eb23 100644 --- a/test/basic.js +++ b/test/basic.js @@ -72,7 +72,12 @@ function createDefaultsTest (opts) { t.true(equal, 'File under subdirectory of packaged app directory should match source file and not be ignored by default') fs.exists(path.join(resourcesPath, 'default_app'), function (exists) { - t.false(exists, 'The output directory should not contain the Electron default app') + t.false(exists, 'The output directory should not contain the Electron default app directory') + cb() + }) + }, function (cb) { + fs.exists(path.join(resourcesPath, 'default_app.asar'), function (exists) { + t.false(exists, 'The output directory should not contain the Electron default app asar file') cb() }) } From 6f730b88cea357a257ab942161c229bf2eeb1e09 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 7 Apr 2016 23:10:57 -0700 Subject: [PATCH 2/2] Add Electron 0.37.4-specific test for default_app.asar --- test/basic.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/basic.js b/test/basic.js index 2818eb23..f7a29580 100644 --- a/test/basic.js +++ b/test/basic.js @@ -87,6 +87,32 @@ function createDefaultsTest (opts) { } } +function createDefaultAppAsarTest (opts) { + return function (t) { + t.timeoutAfter(config.timeout) + + opts.name = 'el0374Test' + opts.dir = path.join(__dirname, 'fixtures', 'el-0374') + opts.version = '0.37.4' + + var resourcesPath + + waterfall([ + function (cb) { + packager(opts, cb) + }, function (paths, cb) { + resourcesPath = path.join(paths[0], util.generateResourcesPath(opts)) + fs.exists(path.join(resourcesPath, 'default_app.asar'), function (exists) { + t.false(exists, 'The output directory should not contain the Electron default_app.asar file') + cb() + }) + } + ], function (err) { + t.end(err) + }) + } +} + function createOutTest (opts) { return function (t) { t.timeoutAfter(config.timeout) @@ -448,6 +474,7 @@ function createIgnoreImplicitOutDirTest (opts) { util.testAllPlatforms('infer test', createInferTest) util.testAllPlatforms('defaults test', createDefaultsTest) +util.testAllPlatforms('default_app.asar removal test', createDefaultAppAsarTest) util.testAllPlatforms('out test', createOutTest) util.testAllPlatforms('asar test', createAsarTest) util.testAllPlatforms('prune test', createPruneTest)