From 5a8885aeed7a278ef1878492186e39284e9673ff Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 14:04:50 -0700 Subject: [PATCH 01/16] Revert "Revert "Add asar support in Atom"" --- apm/package.json | 2 +- build/Gruntfile.coffee | 4 ++-- build/package.json | 1 + build/tasks/build-task.coffee | 6 +++--- build/tasks/generate-asar-task.coffee | 19 +++++++++++++++++++ build/tasks/generate-license-task.coffee | 2 +- script/mkdeb | 2 +- src/atom.coffee | 6 +++--- src/browser/atom-application.coffee | 2 +- src/browser/squirrel-update.coffee | 2 +- src/command-installer.coffee | 13 ++++++------- src/package-manager.coffee | 2 +- src/task.coffee | 7 ++++++- 13 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 build/tasks/generate-asar-task.coffee diff --git a/apm/package.json b/apm/package.json index 84f73451d..e7a0c8fdc 100644 --- a/apm/package.json +++ b/apm/package.json @@ -6,6 +6,6 @@ "url": "https://github.com/atom/atom.git" }, "dependencies": { - "atom-package-manager": "0.157.0" + "atom-package-manager": "0.158.0" } } diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index dac5c8f1f..e2ca43e07 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -223,7 +223,7 @@ module.exports = (grunt) -> ciTasks = ['output-disk-space', 'download-atom-shell', 'download-atom-shell-chromedriver', 'build'] ciTasks.push('dump-symbols') if process.platform isnt 'win32' - ciTasks.push('set-version', 'check-licenses', 'lint') + ciTasks.push('set-version', 'check-licenses', 'lint', 'generate-asar') ciTasks.push('mkdeb') if process.platform is 'linux' ciTasks.push('create-windows-installer') if process.platform is 'win32' ciTasks.push('test') if process.platform is 'darwin' @@ -231,6 +231,6 @@ module.exports = (grunt) -> ciTasks.push('publish-build') grunt.registerTask('ci', ciTasks) - defaultTasks = ['download-atom-shell', 'download-atom-shell-chromedriver', 'build', 'set-version'] + defaultTasks = ['download-atom-shell', 'download-atom-shell-chromedriver', 'build', 'set-version', 'generate-asar'] defaultTasks.push 'install' unless process.platform is 'linux' grunt.registerTask('default', defaultTasks) diff --git a/build/package.json b/build/package.json index 565d7edb7..f9829f4b5 100644 --- a/build/package.json +++ b/build/package.json @@ -6,6 +6,7 @@ "url": "https://github.com/atom/atom.git" }, "dependencies": { + "asar": "^0.4.0", "async": "~0.2.9", "donna": "1.0.10", "formidable": "~1.0.14", diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index 57d9f7964..81ec1e17f 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -22,7 +22,7 @@ module.exports = (grunt) -> mkdir appDir if process.platform isnt 'win32' - cp 'atom.sh', path.join(appDir, 'atom.sh') + cp 'atom.sh', path.resolve(appDir, '..', 'atom.sh') cp 'package.json', path.join(appDir, 'package.json') @@ -147,9 +147,9 @@ module.exports = (grunt) -> cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/ cp 'static', path.join(appDir, 'static') - cp path.join('apm', 'node_modules', 'atom-package-manager'), path.join(appDir, 'apm'), filter: filterNodeModule + cp path.join('apm', 'node_modules', 'atom-package-manager'), path.resolve(appDir, '..', 'apm'), filter: filterNodeModule if process.platform isnt 'win32' - fs.symlinkSync(path.join('..', '..', 'bin', 'apm'), path.join(appDir, 'apm', 'node_modules', '.bin', 'apm')) + fs.symlinkSync(path.join('..', '..', 'bin', 'apm'), path.resolve(appDir, '..', 'apm', 'node_modules', '.bin', 'apm')) if process.platform is 'darwin' grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) -> diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee new file mode 100644 index 000000000..1f74fbf5d --- /dev/null +++ b/build/tasks/generate-asar-task.coffee @@ -0,0 +1,19 @@ +asar = require 'asar' +fs = require 'fs' +path = require 'path' + +module.exports = (grunt) -> + {rm} = require('./task-helpers')(grunt) + + grunt.registerTask 'generate-asar', 'Generate asar archive for the app', -> + done = @async() + + appDir = grunt.config.get('atom.appDir') + unless fs.existsSync(appDir) + grunt.log.error 'The app has to be built before generating asar archive.' + return done(false) + + asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '*.node'}, (err) -> + return done(err) if err? + rm appDir + done() diff --git a/build/tasks/generate-license-task.coffee b/build/tasks/generate-license-task.coffee index 6b616f5cb..eaf1a9a66 100644 --- a/build/tasks/generate-license-task.coffee +++ b/build/tasks/generate-license-task.coffee @@ -17,7 +17,7 @@ module.exports = (grunt) -> licenseText = getLicenseText(dependencyLicenses) if mode is 'save' - targetPath = path.join(grunt.config.get('atom.appDir'), 'LICENSE.md') + targetPath = path.resolve(grunt.config.get('atom.appDir'), '..', 'LICENSE.md') fs.writeFileSync(targetPath, licenseText) else console.log licenseText diff --git a/script/mkdeb b/script/mkdeb index 272fe23f3..c39b6d649 100755 --- a/script/mkdeb +++ b/script/mkdeb @@ -33,7 +33,7 @@ cp "$ICON_FILE" "$TARGET/usr/share/pixmaps" # Copy generated LICENSE.md to /usr/share/doc/atom/copyright mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/atom" -cp "$TARGET/usr/share/atom/resources/app/LICENSE.md" "$TARGET/usr/share/doc/atom/copyright" +cp "$TARGET/usr/share/atom/resources/LICENSE.md" "$TARGET/usr/share/doc/atom/copyright" # Add lintian overrides mkdir -m $FILE_MODE -p "$TARGET/usr/share/lintian/overrides" diff --git a/src/atom.coffee b/src/atom.coffee index 8016d0971..58f940548 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -215,7 +215,7 @@ class Atom extends Model if openDevTools @openDevTools() - @executeJavaScriptInDevTools('InspectorFrontendAPI.showConsole()') + @executeJavaScriptInDevTools('DevToolsAPI.showConsole()') @emit 'uncaught-error', arguments... if includeDeprecatedAPIs @emitter.emit 'did-throw-error', {message, url, line, column, originalError} @@ -577,9 +577,9 @@ class Atom extends Model {resourcePath, safeMode} = @getLoadSettings() CommandInstaller = require './command-installer' - CommandInstaller.installAtomCommand resourcePath, false, (error) -> + CommandInstaller.installAtomCommand false, (error) -> console.warn error.message if error? - CommandInstaller.installApmCommand resourcePath, false, (error) -> + CommandInstaller.installApmCommand false, (error) -> console.warn error.message if error? dimensions = @restoreWindowDimensions() diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index b7a2ca5c0..dbe29caab 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -196,7 +196,7 @@ class AtomApplication @openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap') @openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets') @openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet') - @openPathOnEvent('application:open-license', path.join(@resourcePath, 'LICENSE.md')) + @openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md')) app.on 'window-all-closed', -> app.quit() if process.platform in ['win32', 'linux'] diff --git a/src/browser/squirrel-update.coffee b/src/browser/squirrel-update.coffee index 1603a7c0a..3bdd84223 100644 --- a/src/browser/squirrel-update.coffee +++ b/src/browser/squirrel-update.coffee @@ -142,7 +142,7 @@ addCommandsToPath = (callback) -> atomShCommand = "#!/bin/sh\r\n\"$0/../#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\"" apmCommandPath = path.join(binFolder, 'apm.cmd') - relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd')) + relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'apm', 'bin', 'apm.cmd')) apmCommand = "@echo off\r\n\"%~dp0\\#{relativeApmPath}\" %*" apmShCommandPath = path.join(binFolder, 'apm') diff --git a/src/command-installer.coffee b/src/command-installer.coffee index c0ed22482..f18a05199 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -36,12 +36,11 @@ module.exports = message: "Failed to install shell commands" detailedMessage: error.message - resourcePath = atom.getLoadSettings().resourcePath - @installAtomCommand resourcePath, true, (error) => + @installAtomCommand true, (error) => if error? showErrorDialog(error) else - @installApmCommand resourcePath, true, (error) -> + @installApmCommand true, (error) -> if error? showErrorDialog(error) else @@ -49,12 +48,12 @@ module.exports = message: "Commands installed." detailedMessage: "The shell commands `atom` and `apm` are installed." - installAtomCommand: (resourcePath, askForPrivilege, callback) -> - commandPath = path.join(resourcePath, 'atom.sh') + installAtomCommand: (askForPrivilege, callback) -> + commandPath = path.join(process.resourcesPath, 'atom.sh') @createSymlink commandPath, askForPrivilege, callback - installApmCommand: (resourcePath, askForPrivilege, callback) -> - commandPath = path.join(resourcePath, 'apm', 'node_modules', '.bin', 'apm') + installApmCommand: (askForPrivilege, callback) -> + commandPath = path.join(process.resourcesPath, 'apm', 'node_modules', '.bin', 'apm') @createSymlink commandPath, askForPrivilege, callback createSymlink: (commandPath, askForPrivilege, callback) -> diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 386a65e68..829cae804 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -111,7 +111,7 @@ class PackageManager commandName = 'apm' commandName += '.cmd' if process.platform is 'win32' - apmRoot = path.resolve(__dirname, '..', 'apm') + apmRoot = path.join(process.resourcesPath, 'apm') @apmPath = path.join(apmRoot, 'bin', commandName) unless fs.isFileSync(@apmPath) @apmPath = path.join(apmRoot, 'node_modules', 'atom-package-manager', 'bin', commandName) diff --git a/src/task.coffee b/src/task.coffee index 9572494b8..d752ea11d 100644 --- a/src/task.coffee +++ b/src/task.coffee @@ -83,7 +83,7 @@ class Task taskPath = taskPath.replace(/\\/g, "\\\\") env = _.extend({}, process.env, {taskPath, userAgent: navigator.userAgent}) - @childProcess = fork '--eval', [bootstrap], {env, cwd: __dirname} + @childProcess = fork '--eval', [bootstrap], {env, silent: true} @on "task:log", -> console.log(arguments...) @on "task:warn", -> console.warn(arguments...) @@ -100,6 +100,11 @@ class Task @childProcess.removeAllListeners() @childProcess.on 'message', ({event, args}) => @emit(event, args...) if @childProcess? + # Catch the errors that happened before task-bootstrap. + @childProcess.stdout.on 'data', (data) -> + console.log data.toString() + @childProcess.stderr.on 'data', (data) -> + console.error data.toString() # Public: Starts the task. # From a61f732cf808558b272d18ad9a2ee3ff5786dbe7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 14:30:32 -0700 Subject: [PATCH 02/16] Keep apm and atom.sh in app folder --- build/tasks/build-task.coffee | 6 +++--- build/tasks/generate-asar-task.coffee | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index 81ec1e17f..f49079d19 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -22,7 +22,7 @@ module.exports = (grunt) -> mkdir appDir if process.platform isnt 'win32' - cp 'atom.sh', path.resolve(appDir, '..', 'atom.sh') + cp 'atom.sh', path.resolve(appDir, '..', 'new-app', 'atom.sh') cp 'package.json', path.join(appDir, 'package.json') @@ -147,9 +147,9 @@ module.exports = (grunt) -> cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/ cp 'static', path.join(appDir, 'static') - cp path.join('apm', 'node_modules', 'atom-package-manager'), path.resolve(appDir, '..', 'apm'), filter: filterNodeModule + cp path.join('apm', 'node_modules', 'atom-package-manager'), path.resolve(appDir, '..', 'new-app', 'apm'), filter: filterNodeModule if process.platform isnt 'win32' - fs.symlinkSync(path.join('..', '..', 'bin', 'apm'), path.resolve(appDir, '..', 'apm', 'node_modules', '.bin', 'apm')) + fs.symlinkSync(path.join('..', '..', 'bin', 'apm'), path.resolve(appDir, '..', 'new-app', 'apm', 'node_modules', '.bin', 'apm')) if process.platform is 'darwin' grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) -> diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index 1f74fbf5d..d08c169e2 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -3,7 +3,7 @@ fs = require 'fs' path = require 'path' module.exports = (grunt) -> - {rm} = require('./task-helpers')(grunt) + {cp, rm} = require('./task-helpers')(grunt) grunt.registerTask 'generate-asar', 'Generate asar archive for the app', -> done = @async() @@ -15,5 +15,7 @@ module.exports = (grunt) -> asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '*.node'}, (err) -> return done(err) if err? + rm appDir + fs.renameSync path.resolve(appDir, '..', 'new-app'), appDir done() From 00e91dc9df1e361b43373a8351b28990d27d96db Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 14:31:37 -0700 Subject: [PATCH 03/16] Look for apm in app folder --- src/package-manager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 829cae804..8527188d3 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -111,7 +111,7 @@ class PackageManager commandName = 'apm' commandName += '.cmd' if process.platform is 'win32' - apmRoot = path.join(process.resourcesPath, 'apm') + apmRoot = path.join(process.resourcesPath, 'app', 'apm') @apmPath = path.join(apmRoot, 'bin', commandName) unless fs.isFileSync(@apmPath) @apmPath = path.join(apmRoot, 'node_modules', 'atom-package-manager', 'bin', commandName) From df28212bdfdead32b9025091c15c2d2ff3fbafeb Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 14:33:39 -0700 Subject: [PATCH 04/16] Expect atom.sh and apm in app folder --- src/command-installer.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command-installer.coffee b/src/command-installer.coffee index f18a05199..2f3f78b17 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -49,11 +49,11 @@ module.exports = detailedMessage: "The shell commands `atom` and `apm` are installed." installAtomCommand: (askForPrivilege, callback) -> - commandPath = path.join(process.resourcesPath, 'atom.sh') + commandPath = path.join(process.resourcesPath, 'app', 'atom.sh') @createSymlink commandPath, askForPrivilege, callback installApmCommand: (askForPrivilege, callback) -> - commandPath = path.join(process.resourcesPath, 'apm', 'node_modules', '.bin', 'apm') + commandPath = path.join(process.resourcesPath, 'app', 'apm', 'node_modules', '.bin', 'apm') @createSymlink commandPath, askForPrivilege, callback createSymlink: (commandPath, askForPrivilege, callback) -> From 245f4585cd9fbe8eff568e031197a4146370aee4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 14:52:34 -0700 Subject: [PATCH 05/16] Unpack ctags --- build/tasks/generate-asar-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index d08c169e2..764fccb02 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -13,7 +13,7 @@ module.exports = (grunt) -> grunt.log.error 'The app has to be built before generating asar archive.' return done(false) - asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '*.node'}, (err) -> + asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '{*.node,ctags-darwin,ctags-linux,ctags-win32.exe}'}, (err) -> return done(err) if err? rm appDir From 8e5323d154bd41d9eff3760ce8a979c46405ae68 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 14:53:49 -0700 Subject: [PATCH 06/16] apm is back in app folder --- src/browser/squirrel-update.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/squirrel-update.coffee b/src/browser/squirrel-update.coffee index 3bdd84223..1603a7c0a 100644 --- a/src/browser/squirrel-update.coffee +++ b/src/browser/squirrel-update.coffee @@ -142,7 +142,7 @@ addCommandsToPath = (callback) -> atomShCommand = "#!/bin/sh\r\n\"$0/../#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\"" apmCommandPath = path.join(binFolder, 'apm.cmd') - relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'apm', 'bin', 'apm.cmd')) + relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd')) apmCommand = "@echo off\r\n\"%~dp0\\#{relativeApmPath}\" %*" apmShCommandPath = path.join(binFolder, 'apm') From d534f2a867b1ab7f74dc16a38a7b2cc9ce4ca711 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 17:39:36 -0700 Subject: [PATCH 07/16] Make ctags executable --- build/tasks/generate-asar-task.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index 764fccb02..1c4e2456e 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -18,4 +18,9 @@ module.exports = (grunt) -> rm appDir fs.renameSync path.resolve(appDir, '..', 'new-app'), appDir + + ctagsFolder = path.join("#{appDir}.asar.unpacked", 'node_modules', 'symbols-view', 'vendor') + for ctagsFile in fs.readdirSync(ctagsFolder) + fs.chmodSync(path.join(ctagsFolder, ctagsFile), "755") + done() From 6fcca86ede55c527ed280fdd298074883815575d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 8 Apr 2015 17:41:56 -0700 Subject: [PATCH 08/16] Unpack .ctags file --- build/tasks/generate-asar-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index 1c4e2456e..775a7c92f 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -13,7 +13,7 @@ module.exports = (grunt) -> grunt.log.error 'The app has to be built before generating asar archive.' return done(false) - asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '{*.node,ctags-darwin,ctags-linux,ctags-win32.exe}'}, (err) -> + asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '{*.node,ctags-darwin,ctags-linux,ctags-win32.exe,\\.ctags}'}, (err) -> return done(err) if err? rm appDir From 1c6ee82c6d68e0b01d879d5f2aca36be86ccde56 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 10:11:28 -0700 Subject: [PATCH 09/16] Don't bundle native-mate It makes the apm paths long and is only used during the build --- build/tasks/build-task.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index f49079d19..3411f4dae 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -65,6 +65,7 @@ module.exports = (grunt) -> path.join('jasmine-node', 'node_modules', 'gaze') path.join('jasmine-node', 'spec') path.join('node_modules', 'nan') + path.join('node_modules', 'native-mate') path.join('build', 'binding.Makefile') path.join('build', 'config.gypi') path.join('build', 'gyp-mac-tool') From 1c5726b60c7d288437b9800cca7fb0bae141230f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 10:13:45 -0700 Subject: [PATCH 10/16] :arrow_up: grunt-atom-shell-installer@0.29 --- build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package.json b/build/package.json index f9829f4b5..0403d04e0 100644 --- a/build/package.json +++ b/build/package.json @@ -13,7 +13,7 @@ "fs-plus": "2.x", "github-releases": "~0.2.0", "grunt": "~0.4.1", - "grunt-atom-shell-installer": "^0.28.0", + "grunt-atom-shell-installer": "^0.29.0", "grunt-cli": "~0.1.9", "grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe", "grunt-contrib-coffee": "~0.12.0", From 9f3ee0842e5984c917e75b185799c9dc9f73bd8a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 10:30:47 -0700 Subject: [PATCH 11/16] :art: --- build/tasks/generate-asar-task.coffee | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index 775a7c92f..81c3aae0b 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -8,12 +8,21 @@ module.exports = (grunt) -> grunt.registerTask 'generate-asar', 'Generate asar archive for the app', -> done = @async() + unpack = [ + '*.node' + 'ctags-darwin' + 'ctags-linux' + 'ctags-win32.exe' + '\\.ctags' + ] + unpack = "{#{unpack.join(',')}}" + appDir = grunt.config.get('atom.appDir') unless fs.existsSync(appDir) grunt.log.error 'The app has to be built before generating asar archive.' return done(false) - asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack: '{*.node,ctags-darwin,ctags-linux,ctags-win32.exe,\\.ctags}'}, (err) -> + asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack}, (err) -> return done(err) if err? rm appDir From 19b6043e92198181e6b003d0b40e3d052bfa7406 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 12:17:54 -0700 Subject: [PATCH 12/16] Update .ctags pattern for unpacking --- build/tasks/generate-asar-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index 81c3aae0b..ea09af862 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -10,10 +10,10 @@ module.exports = (grunt) -> unpack = [ '*.node' + '*.ctags' 'ctags-darwin' 'ctags-linux' 'ctags-win32.exe' - '\\.ctags' ] unpack = "{#{unpack.join(',')}}" From 324b68c79594b38cafa3b37c3c9aabf8b49821c6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 12:39:01 -0700 Subject: [PATCH 13/16] Remove unneeded * --- build/tasks/generate-asar-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/generate-asar-task.coffee b/build/tasks/generate-asar-task.coffee index ea09af862..a71d88dfe 100644 --- a/build/tasks/generate-asar-task.coffee +++ b/build/tasks/generate-asar-task.coffee @@ -10,7 +10,7 @@ module.exports = (grunt) -> unpack = [ '*.node' - '*.ctags' + '.ctags' 'ctags-darwin' 'ctags-linux' 'ctags-win32.exe' From e6a49c45316902f5ffcca2e998800727966dc827 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 13:32:00 -0700 Subject: [PATCH 14/16] Remove unused resource path --- src/atom.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atom.coffee b/src/atom.coffee index 58f940548..e2544640d 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -574,7 +574,7 @@ class Atom extends Model # Call this method when establishing a real application window. startEditorWindow: -> - {resourcePath, safeMode} = @getLoadSettings() + {safeMode} = @getLoadSettings() CommandInstaller = require './command-installer' CommandInstaller.installAtomCommand false, (error) -> From 2c5655b7d2ea26523ba5617588915dc96d319679 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Apr 2015 13:33:12 -0700 Subject: [PATCH 15/16] Remove unused requires --- src/command-installer.coffee | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/command-installer.coffee b/src/command-installer.coffee index 2f3f78b17..afd5000c1 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -1,6 +1,4 @@ path = require 'path' -_ = require 'underscore-plus' -async = require 'async' fs = require 'fs-plus' runas = null # defer until used From 65420bd6cea22b046bb3e5134b9ab329b724d3ef Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 15 Apr 2015 11:28:36 -0700 Subject: [PATCH 16/16] Ensure latest asar is used --- build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package.json b/build/package.json index 0403d04e0..3f0a3caef 100644 --- a/build/package.json +++ b/build/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/atom/atom.git" }, "dependencies": { - "asar": "^0.4.0", + "asar": "^0.4.4", "async": "~0.2.9", "donna": "1.0.10", "formidable": "~1.0.14",