From e9208cc58026cbe50b247135472f64558fc448a7 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 30 May 2017 10:48:04 -0700 Subject: [PATCH 1/7] Revert "Delete obsolete asar code" This reverts commit 889f480c354e225237155531952ee089dc879254. --- script/lib/package-application.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/script/lib/package-application.js b/script/lib/package-application.js index 5e01e5543..8c4127b4f 100644 --- a/script/lib/package-application.js +++ b/script/lib/package-application.js @@ -95,6 +95,20 @@ function chmodNodeFiles (packagedAppPath) { childProcess.execSync(`find "${packagedAppPath}" -type f -name *.node -exec chmod a-x {} \\;`) } +function buildAsarUnpackGlobExpression () { + const unpack = [ + '*.node', + 'ctags-config', + 'ctags-darwin', + 'ctags-linux', + 'ctags-win32.exe', + path.join('**', 'node_modules', 'spellchecker', '**'), + path.join('**', 'resources', 'atom.png') + ] + + return `{${unpack.join(',')}}` +} + function getAppName () { if (process.platform === 'darwin') { return CONFIG.channel === 'beta' ? 'Atom Beta' : 'Atom' From 75b91cf8c08cf1ebc821d476e64d898e821de721 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 30 May 2017 10:52:36 -0700 Subject: [PATCH 2/7] Bring back the asar package command --- script/lib/package-application.js | 1 + 1 file changed, 1 insertion(+) diff --git a/script/lib/package-application.js b/script/lib/package-application.js index 8c4127b4f..1e63b8dc0 100644 --- a/script/lib/package-application.js +++ b/script/lib/package-application.js @@ -19,6 +19,7 @@ module.exports = function () { 'app-copyright': `Copyright © 2014-${(new Date()).getFullYear()} GitHub, Inc. All rights reserved.`, 'app-version': CONFIG.appMetadata.version, 'arch': process.platform === 'darwin' ? 'x64' : process.arch, // OS X is 64-bit only + 'asar': {unpack: buildAsarUnpackGlobExpression()}, 'build-version': CONFIG.appMetadata.version, 'download': {cache: CONFIG.electronDownloadPath}, 'dir': CONFIG.intermediateAppPath, From 4b3e298e3cbc42a2cc7082418a25592511f3614a Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Wed, 31 May 2017 12:07:54 -0700 Subject: [PATCH 3/7] Revert "Copy atom.png from the appropriate location on Linux" This reverts commit 6aacd3d76e314d6ebc0780644843bbddd5cbc851. --- script/lib/create-debian-package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/create-debian-package.js b/script/lib/create-debian-package.js index 9c545d6d8..120463f7b 100644 --- a/script/lib/create-debian-package.js +++ b/script/lib/create-debian-package.js @@ -98,7 +98,7 @@ module.exports = function (packagedAppPath) { console.log(`Copying icon into "${debianPackageIconsDirPath}"`) fs.copySync( - path.join(packagedAppPath, 'resources', 'app', 'resources', 'atom.png'), + path.join(packagedAppPath, 'resources', 'app.asar.unpacked', 'resources', 'atom.png'), path.join(debianPackageIconsDirPath, `${atomExecutableName}.png`) ) From 33f5cdd7b3fa007fd5dbfc32c09dd3ab1f9f8687 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Fri, 2 Jun 2017 11:37:44 -0700 Subject: [PATCH 4/7] Put Shell scripts outside of ASAR --- script/lib/include-path-in-packaged-app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/lib/include-path-in-packaged-app.js b/script/lib/include-path-in-packaged-app.js index 71daaa0bd..ae785ccba 100644 --- a/script/lib/include-path-in-packaged-app.js +++ b/script/lib/include-path-in-packaged-app.js @@ -59,6 +59,10 @@ const EXCLUDE_REGEXPS_SOURCES = [ // Ignore *.cc and *.h files from native modules escapeRegExp(path.sep) + '.+\\.(cc|h)$', + // Shell scripts need to be outside of ASAR because Git will call them + // directly + escapeRegExp(path.join('node_modules', 'github', 'bin')), + // Ignore build files escapeRegExp(path.sep) + 'binding\\.gyp$', escapeRegExp(path.sep) + '.+\\.target.mk$', From 440bd7e7d8da9175a932c42136e3ce173165911c Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Fri, 2 Jun 2017 13:41:39 -0700 Subject: [PATCH 5/7] Also exclude Dugite's copy of git --- script/lib/include-path-in-packaged-app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/lib/include-path-in-packaged-app.js b/script/lib/include-path-in-packaged-app.js index ae785ccba..1a93d9661 100644 --- a/script/lib/include-path-in-packaged-app.js +++ b/script/lib/include-path-in-packaged-app.js @@ -59,9 +59,10 @@ const EXCLUDE_REGEXPS_SOURCES = [ // Ignore *.cc and *.h files from native modules escapeRegExp(path.sep) + '.+\\.(cc|h)$', - // Shell scripts need to be outside of ASAR because Git will call them - // directly + // Shell scripts need to be outside of ASAR because Git will call them + // directly. Dugite also needs to be excluded escapeRegExp(path.join('node_modules', 'github', 'bin')), + escapeRegExp(path.join('node_modules', 'dugite', 'git')), // Ignore build files escapeRegExp(path.sep) + 'binding\\.gyp$', From 22d48ea117e655746e4bb5a8f3dab868ad05fabb Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 13 Jun 2017 14:42:39 -0700 Subject: [PATCH 6/7] What was I thinking --- script/lib/include-path-in-packaged-app.js | 5 ----- script/lib/package-application.js | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/script/lib/include-path-in-packaged-app.js b/script/lib/include-path-in-packaged-app.js index 1a93d9661..71daaa0bd 100644 --- a/script/lib/include-path-in-packaged-app.js +++ b/script/lib/include-path-in-packaged-app.js @@ -59,11 +59,6 @@ const EXCLUDE_REGEXPS_SOURCES = [ // Ignore *.cc and *.h files from native modules escapeRegExp(path.sep) + '.+\\.(cc|h)$', - // Shell scripts need to be outside of ASAR because Git will call them - // directly. Dugite also needs to be excluded - escapeRegExp(path.join('node_modules', 'github', 'bin')), - escapeRegExp(path.join('node_modules', 'dugite', 'git')), - // Ignore build files escapeRegExp(path.sep) + 'binding\\.gyp$', escapeRegExp(path.sep) + '.+\\.target.mk$', diff --git a/script/lib/package-application.js b/script/lib/package-application.js index 1e63b8dc0..842883e51 100644 --- a/script/lib/package-application.js +++ b/script/lib/package-application.js @@ -104,6 +104,8 @@ function buildAsarUnpackGlobExpression () { 'ctags-linux', 'ctags-win32.exe', path.join('**', 'node_modules', 'spellchecker', '**'), + path.join('**', 'node_modules', 'dugite', 'git', '**'), + path.join('**', 'node_modules', 'github', 'bin', '**'), path.join('**', 'resources', 'atom.png') ] From a02b2310ec947bad3e76d27659b5a76a49edb9ae Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Wed, 14 Jun 2017 13:04:44 -0700 Subject: [PATCH 7/7] :up-arrow: GitHub for ASAR fixes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a44079da..adf768751 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "exception-reporting": "0.41.4", "find-and-replace": "0.208.3", "fuzzy-finder": "1.5.8", - "github": "0.3.3", + "github": "0.3.4", "git-diff": "1.3.6", "go-to-line": "0.32.1", "grammar-selector": "0.49.5",