From e919eb3eba505d38186be89139766f6a2f877aec Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 16 Mar 2014 14:05:06 +0000 Subject: [PATCH 01/17] Upgrade to atom-shell@0.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07192b145..4e839510d 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "All Rights Reserved", - "atomShellVersion": "0.10.7", + "atomShellVersion": "0.11.0", "dependencies": { "async": "0.2.6", "bootstrap": "git://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372", From 7d997f6d9af68b2b7420e0c27c2fe288c73476ca Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 17 Mar 2014 04:11:31 +0000 Subject: [PATCH 02/17] Use multi-platform-node branch of apm. --- vendor/apm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/apm b/vendor/apm index 537ac1ed9..9cce4c431 160000 --- a/vendor/apm +++ b/vendor/apm @@ -1 +1 @@ -Subproject commit 537ac1ed906cd42aff61aa3b04786cb1f28430a8 +Subproject commit 9cce4c4311f2020f0379915f680791d12b467f5d From 6bd372854807b4b9d621e71083b54afe70caebad Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 17 Mar 2014 07:28:36 +0000 Subject: [PATCH 03/17] Fix grunt on Linux. --- build/Gruntfile.coffee | 12 +++++++++++- build/tasks/build-task.coffee | 2 +- build/tasks/set-version-task.coffee | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index a1e54fe1e..338bd9bb6 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -46,7 +46,7 @@ module.exports = (grunt) -> contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells') - else + else if process.platform is 'darwin' appName = 'Atom.app' tmpDir = '/tmp' installRoot = '/Applications' @@ -56,6 +56,16 @@ module.exports = (grunt) -> contentsDir = path.join(shellAppDir, 'Contents') appDir = path.join(contentsDir, 'Resources', 'app') atomShellDownloadDir = '/tmp/atom-cached-atom-shells' + else + appName = 'Atom' + tmpDir = '/tmp' + installRoot = '/opt' + buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') + symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') + shellAppDir = path.join(buildDir, appName) + contentsDir = shellAppDir + appDir = path.join(shellAppDir, 'resources', 'app') + atomShellDownloadDir = '/tmp/atom-cached-atom-shells' installDir = path.join(installRoot, appName) diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index 5197f4cf4..ef6c6c270 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -14,7 +14,7 @@ module.exports = (grunt) -> if process.platform is 'darwin' cp 'atom-shell/Atom.app', shellAppDir - else if process.platform is 'win32' + else cp 'atom-shell', shellAppDir mkdir appDir diff --git a/build/tasks/set-version-task.coffee b/build/tasks/set-version-task.coffee index bdf6e0c4d..a5fb685b8 100644 --- a/build/tasks/set-version-task.coffee +++ b/build/tasks/set-version-task.coffee @@ -48,3 +48,5 @@ module.exports = (grunt) -> rcedit = require('rcedit') rcedit(shellExePath, {'version-string': strings}, done) + else + done() From 705d3e9fbceddb26d79051e6d3854869ba5bcd00 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 17 Mar 2014 07:44:58 +0000 Subject: [PATCH 04/17] Do not run grunt install on Linux by default. On Linux we usually separate build from install, and only run install with sudo when needed. --- build/Gruntfile.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 338bd9bb6..118824f1f 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -237,4 +237,7 @@ module.exports = (grunt) -> grunt.registerTask('test', ['shell:kill-atom', 'run-specs']) grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'dump-symbols', 'set-version', 'check-licenses', 'lint', 'test', 'codesign', 'publish-build']) grunt.registerTask('docs', ['markdown:guides', 'build-docs']) - grunt.registerTask('default', ['download-atom-shell', 'build', 'set-version', 'install']) + + defaultTasks = ['download-atom-shell', 'build', 'set-version'] + defaultTasks.push 'install' unless process.platform is 'linux' + grunt.registerTask('default', defaultTasks) From b33f36d30ab4334b9dff9456c12f99e02827cd3e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 12:17:20 +0800 Subject: [PATCH 05/17] Update apm: Fix keytar on Linux. --- vendor/apm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/apm b/vendor/apm index 9cce4c431..b9b21c144 160000 --- a/vendor/apm +++ b/vendor/apm @@ -1 +1 @@ -Subproject commit 9cce4c4311f2020f0379915f680791d12b467f5d +Subproject commit b9b21c1445c0b2e03b2f04d1689094cc5a7deb12 From 696928540c66644a9c4c55c257c5822836d66515 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 12:18:08 +0800 Subject: [PATCH 06/17] Upgrade to keytar@1.x --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e839510d..196485ee6 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "guid": "0.0.10", "jasmine-tagged": ">=1.1.1 <2.0", "mkdirp": "0.3.5", - "keytar": "0.15.1", + "keytar": "1.x", "less-cache": "0.12.0", "loophole": "^0.3.0", "mixto": "1.x", From 7eaa3cb2b6e242818e8179b97cc80a9f4793b7ac Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 12:24:22 +0800 Subject: [PATCH 07/17] Upgrade to grunt-download-atom-shell@0.6.1 --- build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package.json b/build/package.json index db1e1e62c..37102f6e3 100644 --- a/build/package.json +++ b/build/package.json @@ -18,7 +18,7 @@ "grunt-contrib-coffee": "~0.9.0", "grunt-contrib-less": "~0.8.0", "grunt-cson": "0.8.0", - "grunt-download-atom-shell": "git+https://atom-bot:467bac80a0017b96fb5be5cfc686f5e0cc607b10@github.com/atom/grunt-download-atom-shell#v0.6.0", + "grunt-download-atom-shell": "git+https://atom-bot:467bac80a0017b96fb5be5cfc686f5e0cc607b10@github.com/atom/grunt-download-atom-shell#v0.6.1", "grunt-lesslint": "0.13.0", "grunt-markdown": "~0.4.0", "grunt-peg": "~1.1.0", From da8d055817121551507dc4688b2a876af1a93cc7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 14:09:43 +0800 Subject: [PATCH 08/17] :penguin: Quit when all windows are closed. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 130c5c306..d209ffd41 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -196,7 +196,7 @@ class AtomApplication @openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet') app.on 'window-all-closed', -> - app.quit() if process.platform is 'win32' + app.quit() if process.platform in ['win32', 'linux'] app.on 'will-quit', => @killAllProcesses() From 344a56b47a335f136b2bbac4f3e499d417cf8ecf Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 14:12:25 +0800 Subject: [PATCH 09/17] :penguin: Add menu. --- menus/linux.cson | 156 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 menus/linux.cson diff --git a/menus/linux.cson b/menus/linux.cson new file mode 100644 index 000000000..f69ab563c --- /dev/null +++ b/menus/linux.cson @@ -0,0 +1,156 @@ +'menu': [ + { + label: '&File' + submenu: [ + { label: 'New &Window', command: 'application:new-window' } + { label: '&New File', command: 'application:new-file' } + { label: '&Open...', command: 'application:open' } + { label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' } + { type: 'separator' } + { label: '&Preferences...', command: 'application:show-settings' } + { type: 'separator' } + { label: '&Save', command: 'core:save' } + { label: 'Save &As...', command: 'core:save-as' } + { label: 'Save A&ll', command: 'window:save-all' } + { type: 'separator' } + { label: '&Close Buffer', command: 'core:close' } + { label: 'Close All &Buffers', command: 'pane:close' } + { label: 'Clos&e Window', command: 'window:close' } + { type: 'separator' } + { label: 'E&xit', command: 'application:quit' } + ] + } + + { + label: '&Edit' + submenu: [ + { label: '&Undo', command: 'core:undo' } + { label: '&Redo', command: 'core:redo' } + { type: 'separator' } + { label: '&Cut', command: 'core:cut' } + { label: 'C&opy', command: 'core:copy' } + { label: 'Copy Pat&h', command: 'editor:copy-path' } + { label: '&Paste', command: 'core:paste' } + { label: 'Select &All', command: 'core:select-all' } + { type: 'separator' } + { label: '&Toggle Comments', command: 'editor:toggle-line-comments' } + { + label: 'Lines', + submenu: [ + { label: '&Indent', command: 'editor:indent-selected-rows' } + { label: '&Outdent', command: 'editor:outdent-selected-rows' } + { label: '&Auto Indent', command: 'editor:auto-indent' } + { type: 'separator' } + { label: 'Move Line &Up', command: 'editor:move-line-up' } + { label: 'Move Line &Down', command: 'editor:move-line-down' } + { label: 'Du&plicate Lines', command: 'editor:duplicate-lines' } + { label: 'D&elete Line', command: 'editor:delete-line' } + { label: '&Join Lines', command: 'editor:join-lines' } + ] + } + { + label: 'Text', + submenu: [ + { label: '&Upper Case', command: 'editor:upper-case' } + { label: '&Lower Case', command: 'editor:lower-case' } + { type: 'separator' } + { label: 'Delete to End of &Word', command: 'editor:delete-to-end-of-word' } + { label: '&Delete Line', command: 'editor:delete-line' } + { type: 'separator' } + { label: '&Transpose', command: 'editor:transpose' } + ] + } + { + label: 'Folding', + submenu: [ + { label: '&Fold', command: 'editor:fold-current-row' } + { label: '&Unfold', command: 'editor:unfold-current-row' } + { label: 'Unfold &All', command: 'editor:unfold-all' } + { type: 'separator' } + { label: 'Fol&d All', command: 'editor:fold-all' } + { label: 'Fold Level 1', command: 'editor:fold-at-indent-level-1' } + { label: 'Fold Level 2', command: 'editor:fold-at-indent-level-2' } + { label: 'Fold Level 3', command: 'editor:fold-at-indent-level-3' } + { label: 'Fold Level 4', command: 'editor:fold-at-indent-level-4' } + { label: 'Fold Level 5', command: 'editor:fold-at-indent-level-5' } + { label: 'Fold Level 6', command: 'editor:fold-at-indent-level-6' } + { label: 'Fold Level 7', command: 'editor:fold-at-indent-level-7' } + { label: 'Fold Level 8', command: 'editor:fold-at-indent-level-8' } + { label: 'Fold Level 9', command: 'editor:fold-at-indent-level-9' } + ] + } + ] + } + + { + label: '&View' + submenu: [ + { label: '&Reload', command: 'window:reload' } + { label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' } + { + label: 'Developer' + submenu: [ + { label: 'Open In &Dev Mode...', command: 'application:open-dev' } + { label: 'Run &Atom Specs', command: 'application:run-all-specs' } + { label: 'Run Package &Specs', command: 'window:run-package-specs' } + { label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' } + ] + } + { type: 'separator' } + { label: 'Toggle Soft &Wrap', command: 'editor:toggle-soft-wrap' } + ] + } + + { + label: '&Selection' + submenu: [ + { label: 'Add Selection &Above', command: 'editor:add-selection-above' } + { label: 'Add Selection &Below', command: 'editor:add-selection-below' } + { label: 'S&plit into Lines', command: 'editor:split-selections-into-lines'} + { type: 'separator' } + { label: 'Select to &Top', command: 'core:select-to-top' } + { label: 'Select to Botto&m', command: 'core:select-to-bottom' } + { type: 'separator' } + { label: 'Select &Line', command: 'editor:select-line' } + { label: 'Select &Word', command: 'editor:select-word' } + { label: 'Select to Beginning of W&ord', command: 'editor:select-to-beginning-of-word' } + { label: 'Select to Beginning of L&ine', command: 'editor:select-to-beginning-of-line' } + { label: 'Select to First &Character of Line', command: 'editor:select-to-first-character-of-line' } + { label: 'Select to End of Wor&d', command: 'editor:select-to-end-of-word' } + { label: 'Select to End of Lin&e', command: 'editor:select-to-end-of-line' } + ] + } + + { + label: 'F&ind' + submenu: [] + } + + { + label: '&Packages' + submenu: [] + } + + { + label: '&Window' + submenu: [ + { label: 'Mi&nimize', command: 'application:minimize' } + { label: 'Ma&ximize', command: 'application:zoom' } + { type: 'separator' } + { label: 'Bring &All to Front', command: 'application:bring-all-windows-to-front' } + ] + } + + { + label: '&Help' + submenu: [ + { label: '&About Atom...', command: 'application:about' } + { label: 'View &License', command: 'application:open-license' } + { label: "VERSION", enabled: false } + { label: "Install &update", command: 'application:install-update', visible: false } + { type: 'separator' } + { label: '&Documentation', command: 'application:open-documentation' } + { type: 'separator' } + ] + } +] From 87b95128f936ef10ae49f062864a85f831737f44 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 15:34:24 +0800 Subject: [PATCH 10/17] Do not rely on NODE_PATH env. --- src/atom.coffee | 3 +++ src/browser/atom-window.coffee | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/atom.coffee b/src/atom.coffee index 5905902cd..2fe132bce 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -148,6 +148,9 @@ class Atom extends Model {devMode, resourcePath} = @getLoadSettings() configDirPath = @getConfigDirPath() + # Add 'src/exports' to module search path. + require('module').globalPaths.push(path.resolve(resourcePath, 'exports')) + @config = new Config({configDirPath, resourcePath}) @keymap = new Keymap({configDirPath, resourcePath}) @packages = new PackageManager({devMode, configDirPath, resourcePath}) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 618ed06ef..33389403c 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -21,12 +21,7 @@ class AtomWindow {@resourcePath, pathToOpen, initialLine, @isSpec, @exitWhenDone} = settings global.atomApplication.addWindow(this) - @setupNodePath(@resourcePath) @browserWindow = new BrowserWindow show: false, title: 'Atom', icon: @constructor.iconPath - @browserWindow.restart = _.wrap _.bind(@browserWindow.restart, @browserWindow), (restart) => - @setupNodePath(@resourcePath) - restart() - @handleEvents() loadSettings = _.extend({}, settings) @@ -49,9 +44,6 @@ class AtomWindow @openPath(pathToOpen, initialLine) - setupNodePath: (resourcePath) -> - process.env['NODE_PATH'] = path.resolve(resourcePath, 'exports') - getUrl: (loadSettingsObj) -> # Ignore the windowState when passing loadSettings via URL, since it could # be quite large. From cc2e1eecd3dad69e0bc5f64e07e6789bc83abf2f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 15:38:57 +0800 Subject: [PATCH 11/17] Still set NODE_PATH since tasks may need it. --- src/atom.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/atom.coffee b/src/atom.coffee index 2fe132bce..f3954394a 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -149,7 +149,10 @@ class Atom extends Model configDirPath = @getConfigDirPath() # Add 'src/exports' to module search path. - require('module').globalPaths.push(path.resolve(resourcePath, 'exports')) + exportsPath = path.resolve(resourcePath, 'exports') + require('module').globalPaths.push(exportsPath) + # Still set NODE_PATH since tasks may need it. + process.env.NODE_PATH = exportsPath @config = new Config({configDirPath, resourcePath}) @keymap = new Keymap({configDirPath, resourcePath}) From a18536e8a491814c0f2aa2c0898f41bc6a0ac7fe Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 15:51:13 +0800 Subject: [PATCH 12/17] :penguin: Add keymap. --- keymaps/linux.cson | 107 +++++++++++++++++++++++++++++++++++++++++++++ vendor/apm | 2 +- 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 keymaps/linux.cson diff --git a/keymaps/linux.cson b/keymaps/linux.cson new file mode 100644 index 000000000..b9a3364da --- /dev/null +++ b/keymaps/linux.cson @@ -0,0 +1,107 @@ +'body': + # Atom Specific + 'enter': 'core:confirm' + 'escape': 'core:cancel' + 'up': 'core:move-up' + 'down': 'core:move-down' + 'left': 'core:move-left' + 'right': 'core:move-right' + 'ctrl-alt-r': 'window:reload' + 'ctrl-alt-i': 'window:toggle-dev-tools' + 'ctrl-alt-p': 'window:run-package-specs' + 'ctrl-alt-s': 'application:run-all-specs' + + # Sublime Parity + 'ctrl-N': 'application:new-window' + 'ctrl-W': 'window:close' + 'ctrl-o': 'application:open' + 'ctrl-T': 'pane:reopen-closed-item' + 'ctrl-n': 'application:new-file' + 'ctrl-s': 'core:save' + 'ctrl-S': 'core:save-as' + 'ctrl-w': 'core:close' + 'ctrl-z': 'core:undo' + 'ctrl-y': 'core:redo' + 'ctrl-x': 'core:cut' + 'ctrl-c': 'core:copy' + 'ctrl-v': 'core:paste' + 'shift-up': 'core:select-up' + 'shift-down': 'core:select-down' + 'shift-left': 'core:select-left' + 'shift-right': 'core:select-right' + 'delete': 'core:delete' + 'pageup': 'core:page-up' + 'pagedown': 'core:page-down' + 'backspace': 'core:backspace' + 'ctrl-tab': 'pane:show-next-item' + 'ctrl-shift-tab': 'pane:show-previous-item' + 'ctrl-shift-up': 'core:move-up' + 'ctrl-shift-down': 'core:move-down' + 'ctrl-=': 'window:increase-font-size' + 'ctrl-+': 'window:increase-font-size' + 'ctrl--': 'window:decrease-font-size' + 'ctrl-_': 'window:decrease-font-size' + 'ctrl-0': 'window:reset-font-size' + + 'ctrl-k up': 'pane:split-up' # Atom Specific + 'ctrl-k down': 'pane:split-down' # Atom Specific + 'ctrl-k left': 'pane:split-left' # Atom Specific + 'ctrl-k right': 'pane:split-right' # Atom Specific + 'ctrl-k ctrl-w': 'pane:close' # Atom Specific + 'ctrl-k alt-ctrl-w': 'pane:close-other-items' # Atom Specific + 'ctrl-k ctrl-p': 'window:focus-previous-pane' + 'ctrl-k ctrl-n': 'window:focus-next-pane' + 'ctrl-k ctrl-up': 'window:focus-pane-above' + 'ctrl-k ctrl-down': 'window:focus-pane-below' + 'ctrl-k ctrl-left': 'window:focus-pane-on-left' + 'ctrl-k ctrl-right': 'window:focus-pane-on-right' + +'.workspace .editor': + # Windows specific + 'ctrl-delete': 'editor:backspace-to-beginning-of-word' + + # Sublime Parity + 'ctrl-a': 'core:select-all' + 'ctrl-alt-p': 'editor:log-cursor-scope' + 'ctrl-k ctrl-u': 'editor:upper-case' + 'ctrl-k ctrl-l': 'editor:lower-case' + +'.workspace .editor:not(.mini)': + # Atom specific + 'alt-ctrl-z': 'editor:checkout-head-revision' + 'ctrl-<': 'editor:scroll-to-cursor' + 'alt-ctrl-f': 'editor:fold-selection' + + # Sublime Parity + 'ctrl-enter': 'editor:newline-below' + 'ctrl-shift-enter': 'editor:newline-above' + 'ctrl-]': 'editor:indent-selected-rows' + 'ctrl-[': 'editor:outdent-selected-rows' + 'ctrl-up': 'editor:move-line-up' + 'ctrl-down': 'editor:move-line-down' + 'ctrl-/': 'editor:toggle-line-comments' + 'ctrl-j': 'editor:join-lines' + 'ctrl-D': 'editor:duplicate-lines' + + 'ctrl-alt-[': 'editor:fold-current-row' + 'ctrl-alt-]': 'editor:unfold-current-row' + 'ctrl-alt-{': 'editor:fold-all' # Atom Specific + 'ctrl-alt-}': 'editor:unfold-all' # Atom Specific + 'ctrl-k ctrl-0': 'editor:unfold-all' + 'ctrl-k ctrl-1': 'editor:fold-at-indent-level-1' + 'ctrl-k ctrl-2': 'editor:fold-at-indent-level-2' + 'ctrl-k ctrl-3': 'editor:fold-at-indent-level-3' + 'ctrl-k ctrl-4': 'editor:fold-at-indent-level-4' + 'ctrl-k ctrl-5': 'editor:fold-at-indent-level-5' + 'ctrl-k ctrl-6': 'editor:fold-at-indent-level-6' + 'ctrl-k ctrl-7': 'editor:fold-at-indent-level-7' + 'ctrl-k ctrl-8': 'editor:fold-at-indent-level-8' + 'ctrl-k ctrl-9': 'editor:fold-at-indent-level-9' + +# allow standard input fields to work correctly +'body .native-key-bindings': + 'ctrl-z': 'native!' + 'ctrl-Z': 'native!' + 'ctrl-x': 'native!' + 'ctrl-c': 'native!' + 'ctrl-v': 'native!' diff --git a/vendor/apm b/vendor/apm index b9b21c144..c697782ba 160000 --- a/vendor/apm +++ b/vendor/apm @@ -1 +1 @@ -Subproject commit b9b21c1445c0b2e03b2f04d1689094cc5a7deb12 +Subproject commit c697782ba017c653824c48b202e9b7ca4efafd60 From 8bf1464b6421fa65840ba551888fe1682054c0fe Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 15:57:16 +0800 Subject: [PATCH 13/17] Fix setting NODE_PATH in specs window. --- spec/spec-suite.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/spec-suite.coffee b/spec/spec-suite.coffee index a82e0289f..3e4abf22d 100644 --- a/spec/spec-suite.coffee +++ b/spec/spec-suite.coffee @@ -26,6 +26,13 @@ setSpecDirectory = (specDirectory) -> runAllSpecs = -> {resourcePath} = atom.getLoadSettings() + + # Add 'src/exports' to module search path. + exportsPath = path.resolve(resourcePath, 'exports') + require('module').globalPaths.push(exportsPath) + # Still set NODE_PATH since tasks may need it. + process.env.NODE_PATH = exportsPath + # Only run core specs when resource path is the Atom repository if Git.exists(resourcePath) requireSpecs(path.join(resourcePath, 'spec')) From 19ab197bc199a728675afd7f71372cc0f5125560 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 16:27:43 +0800 Subject: [PATCH 14/17] :penguin: Make atom.sh work. --- atom.sh | 56 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/atom.sh b/atom.sh index d844a946a..cd1137051 100755 --- a/atom.sh +++ b/atom.sh @@ -1,15 +1,13 @@ -#!/bin/sh -ATOM_PATH=${ATOM_PATH:-/Applications} # Set ATOM_PATH unless it is already set -ATOM_APP_NAME=Atom.app +#!/bin/bash -# If ATOM_PATH isn't a executable file, use spotlight to search for Atom -if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then - ATOM_PATH=$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | head -1 | xargs dirname) -fi - -# Exit if Atom can't be found -if [ -z "$ATOM_PATH" ]; then - echo "Cannot locate Atom.app, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing Atom.app." +if [ "`uname`" == 'Darwin' ]; then + OS='Mac' +elif [ "`expr substr $(uname -s) 1 5`" == 'Linux' ]; then + OS='Linux' +elif [ "`expr substr $(uname -s) 1 10`" == 'MINGW32_NT' ]; then + OS='Cygwin' +else + echo "Your platform (`uname -a`) is not supported." exit 1 fi @@ -46,11 +44,37 @@ if [ $REDIRECT_STDERR ]; then exec 2> /dev/null fi -if [ $EXPECT_OUTPUT ]; then - "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/Atom" --executed-from="$(pwd)" --pid=$$ "$@" - exit $? -else - open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ "$@" +if [ $OS == 'Mac' ]; then + ATOM_PATH=${ATOM_PATH:-/Applications} # Set ATOM_PATH unless it is already set + ATOM_APP_NAME=Atom.app + + # If ATOM_PATH isn't a executable file, use spotlight to search for Atom + if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then + ATOM_PATH=$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | head -1 | xargs dirname) + fi + + # Exit if Atom can't be found + if [ -z "$ATOM_PATH" ]; then + echo "Cannot locate Atom.app, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing Atom.app." + exit 1 + fi + + if [ $EXPECT_OUTPUT ]; then + "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/Atom" --executed-from="$(pwd)" --pid=$$ "$@" + exit $? + else + open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ "$@" + fi +elif [ $OS == 'Linux' ]; then + ATOM_PATH='/opt/Atom/atom' + [ -x "$ATOM_PATH" ] || ATOM_PATH='/tmp/atom-build/Atom/atom' + + if [ $EXPECT_OUTPUT ]; then + "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" + exit $? + else + nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > /dev/null & + fi fi # Exits this process when Atom is used as $EDITOR From f2e5b480e19640c4541c0d863764766ccf897b33 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 16:32:07 +0800 Subject: [PATCH 15/17] Fix specs on Mac. --- spec/spec-bootstrap.coffee | 8 ++++++++ spec/spec-suite.coffee | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/spec-bootstrap.coffee b/spec/spec-bootstrap.coffee index dd34ffdae..7b86a31cc 100644 --- a/spec/spec-bootstrap.coffee +++ b/spec/spec-bootstrap.coffee @@ -1,6 +1,8 @@ # Start the crash reporter before anything else. require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub') +path = require 'path' + try require '../src/window' Atom = require '../src/atom' @@ -12,6 +14,12 @@ try {runSpecSuite} = require './jasmine-helper' + # Add 'src/exports' to module search path. + exportsPath = path.resolve(atom.getLoadSettings().resourcePath, 'exports') + require('module').globalPaths.push(exportsPath) + # Still set NODE_PATH since tasks may need it. + process.env.NODE_PATH = exportsPath + document.title = "Spec Suite" runSpecSuite './spec-suite', atom.getLoadSettings().logFile catch error diff --git a/spec/spec-suite.coffee b/spec/spec-suite.coffee index 3e4abf22d..568c2132d 100644 --- a/spec/spec-suite.coffee +++ b/spec/spec-suite.coffee @@ -27,12 +27,6 @@ setSpecDirectory = (specDirectory) -> runAllSpecs = -> {resourcePath} = atom.getLoadSettings() - # Add 'src/exports' to module search path. - exportsPath = path.resolve(resourcePath, 'exports') - require('module').globalPaths.push(exportsPath) - # Still set NODE_PATH since tasks may need it. - process.env.NODE_PATH = exportsPath - # Only run core specs when resource path is the Atom repository if Git.exists(resourcePath) requireSpecs(path.join(resourcePath, 'spec')) From 0ae1f6858c7402523a5e5e2f01965bb4afb5c9a0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 17:02:31 +0800 Subject: [PATCH 16/17] Upgrade to apm@0.31.0 --- vendor/apm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/apm b/vendor/apm index c697782ba..093f361f5 160000 --- a/vendor/apm +++ b/vendor/apm @@ -1 +1 @@ -Subproject commit c697782ba017c653824c48b202e9b7ca4efafd60 +Subproject commit 093f361f5897e0d73230c82c1d973ecc96a6e744 From 08601d32a3c9c816ad5a1e1981a124efca02c2ee Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 18 Mar 2014 17:57:34 +0800 Subject: [PATCH 17/17] Upgrade to atom-shell@0.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afb63abaa..e6a4732fa 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "All Rights Reserved", - "atomShellVersion": "0.11.0", + "atomShellVersion": "0.11.1", "dependencies": { "async": "0.2.6", "atom-keymap": "^0.8.0",