diff --git a/menus/darwin.cson b/menus/darwin.cson index 346523299..4ac239e8a 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -9,6 +9,7 @@ { type: 'separator' } { label: 'Preferences...', command: 'application:show-settings' } { label: 'Open Your Config', command: 'application:open-your-config' } + { label: 'Open Your Init Script', command: 'application:open-your-init-script' } { label: 'Open Your Keymap', command: 'application:open-your-keymap' } { label: 'Open Your Snippets', command: 'application:open-your-snippets' } { label: 'Open Your Stylesheet', command: 'application:open-your-stylesheet' } diff --git a/src/atom.coffee b/src/atom.coffee index bc22aa661..9cfffb74a 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -494,8 +494,12 @@ class Atom extends Model shell.beep() if @config.get('core.audioBeep') @workspaceView.trigger 'beep' + getUserInitScriptPath: -> + initScriptPath = fs.resolve(@getConfigDirPath(), 'init', ['js', 'coffee']) + initScriptPath ? path.join(@getConfigDirPath(), 'init.coffee') + requireUserInitScript: -> - if userInitScriptPath = fs.resolve(@getConfigDirPath(), 'user', ['js', 'coffee']) + if userInitScriptPath = @getUserInitScriptPath() try require userInitScriptPath catch error diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 7966b7cc3..149c6f61c 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -189,6 +189,7 @@ class AtomApplication @openPathOnEvent('application:show-settings', 'atom://config') @openPathOnEvent('application:open-your-config', 'atom://.atom/config') + @openPathOnEvent('application:open-your-init-script', 'atom://.atom/init-script') @openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap') @openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets') @openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet') diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index 7e94f7721..6b62a7829 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -107,6 +107,7 @@ class WorkspaceView extends View @command 'application:zoom', -> ipc.sendChannel('command', 'application:zoom') @command 'application:bring-all-windows-to-front', -> ipc.sendChannel('command', 'application:bring-all-windows-to-front') @command 'application:open-your-config', -> ipc.sendChannel('command', 'application:open-your-config') + @command 'application:open-your-init-script', -> ipc.sendChannel('command', 'application:open-your-init-script') @command 'application:open-your-keymap', -> ipc.sendChannel('command', 'application:open-your-keymap') @command 'application:open-your-snippets', -> ipc.sendChannel('command', 'application:open-your-snippets') @command 'application:open-your-stylesheet', -> ipc.sendChannel('command', 'application:open-your-stylesheet') diff --git a/src/workspace.coffee b/src/workspace.coffee index eec5d88ed..ec5b8fa87 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -35,6 +35,8 @@ class Workspace extends Model @open(atom.keymap.getUserKeymapPath()) when 'atom://.atom/config' @open(atom.config.getUserConfigPath()) + when 'atom://.atom/init-script' + @open(atom.getUserInitScriptPath()) # Called by the Serializable mixin during deserialization deserializeParams: (params) ->