diff --git a/apm/package.json b/apm/package.json index e7a0c8fdc70..84f73451d90 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.158.0" + "atom-package-manager": "0.157.0" } } diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index ed4c7b9336d..05efaeb38e0 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', 'generate-asar') + ciTasks.push('set-version', 'check-licenses', 'lint') 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', 'generate-asar'] + defaultTasks = ['download-atom-shell', 'download-atom-shell-chromedriver', 'build', 'set-version'] defaultTasks.push 'install' unless process.platform is 'linux' grunt.registerTask('default', defaultTasks) diff --git a/build/package.json b/build/package.json index ef5b314a038..297ddadfd5a 100644 --- a/build/package.json +++ b/build/package.json @@ -6,7 +6,6 @@ "url": "https://github.com/atom/atom.git" }, "dependencies": { - "asar": "^0.4.0", "async": "~0.2.9", "donna": "1.0.7", "formidable": "~1.0.14", diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index 74e5d8821ff..fcb1eb6a8dc 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.join(appDir, 'atom.sh') cp 'package.json', path.join(appDir, 'package.json') @@ -145,9 +145,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.join(appDir, '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.join(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 deleted file mode 100644 index 1f74fbf5d66..00000000000 --- a/build/tasks/generate-asar-task.coffee +++ /dev/null @@ -1,19 +0,0 @@ -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 eaf1a9a66ac..6b616f5cb41 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.resolve(grunt.config.get('atom.appDir'), '..', 'LICENSE.md') + targetPath = path.join(grunt.config.get('atom.appDir'), 'LICENSE.md') fs.writeFileSync(targetPath, licenseText) else console.log licenseText diff --git a/script/mkdeb b/script/mkdeb index c39b6d64945..272fe23f3a6 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/LICENSE.md" "$TARGET/usr/share/doc/atom/copyright" +cp "$TARGET/usr/share/atom/resources/app/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 f05ce11f6af..a71adeeeb58 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -226,7 +226,7 @@ class Atom extends Model if openDevTools @openDevTools() - @executeJavaScriptInDevTools('DevToolsAPI.showConsole()') + @executeJavaScriptInDevTools('InspectorFrontendAPI.showConsole()') @emit 'uncaught-error', arguments... @emitter.emit 'did-throw-error', {message, url, line, column, originalError} @@ -581,9 +581,9 @@ class Atom extends Model {resourcePath, safeMode} = @getLoadSettings() CommandInstaller = require './command-installer' - CommandInstaller.installAtomCommand false, (error) -> + CommandInstaller.installAtomCommand resourcePath, false, (error) -> console.warn error.message if error? - CommandInstaller.installApmCommand false, (error) -> + CommandInstaller.installApmCommand resourcePath, 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 7d88858c59e..d79b2bf76aa 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -190,7 +190,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(process.resourcesPath, 'LICENSE.md')) + @openPathOnEvent('application:open-license', path.join(@resourcePath, '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 3bdd842238d..1603a7c0a14 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') diff --git a/src/command-installer.coffee b/src/command-installer.coffee index c7772b4f5e3..1d3a16777ae 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -36,11 +36,12 @@ module.exports = message: "Failed to install shell commands" detailedMessage: error.message - @installAtomCommand true, (error) => + resourcePath = atom.getLoadSettings().resourcePath + @installAtomCommand resourcePath, true, (error) => if error? showErrorDialog(error) else - @installApmCommand true, (error) -> + @installApmCommand resourcePath, true, (error) -> if error? showErrorDialog(error) else @@ -48,12 +49,12 @@ module.exports = message: "Commands installed." detailedMessage: "The shell commands `atom` and `apm` are installed." - installAtomCommand: (askForPrivilege, callback) -> - commandPath = path.join(process.resourcesPath, 'atom.sh') + installAtomCommand: (resourcePath, askForPrivilege, callback) -> + commandPath = path.join(resourcePath, 'atom.sh') @createSymlink commandPath, askForPrivilege, callback - installApmCommand: (askForPrivilege, callback) -> - commandPath = path.join(process.resourcesPath, 'apm', 'node_modules', '.bin', 'apm') + installApmCommand: (resourcePath, askForPrivilege, callback) -> + commandPath = path.join(resourcePath, '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 c00087084bd..444497c5b05 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -134,7 +134,7 @@ class PackageManager commandName = 'apm' commandName += '.cmd' if process.platform is 'win32' - apmRoot = path.join(process.resourcesPath, 'apm') + apmRoot = path.resolve(__dirname, '..', '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 d752ea11dde..9572494b826 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, silent: true} + @childProcess = fork '--eval', [bootstrap], {env, cwd: __dirname} @on "task:log", -> console.log(arguments...) @on "task:warn", -> console.warn(arguments...) @@ -100,11 +100,6 @@ 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. #