mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Show Atom's version.
This commit is contained in:
@@ -262,4 +262,4 @@ window.atom =
|
||||
console.error "Failed to load `#{userInitScriptPath}`", error.stack, error
|
||||
|
||||
getVersion: ->
|
||||
@sendMessageToBrowserProcess('getVersion')
|
||||
ipc.sendChannelSync 'get-version'
|
||||
|
||||
@@ -13,6 +13,9 @@ testMode = false
|
||||
getHomeDir = ->
|
||||
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
|
||||
|
||||
getVersion = ->
|
||||
String fs.readFileSync(path.join(__dirname, '..', '..', 'version'))
|
||||
|
||||
setupNodePath = ->
|
||||
resourcePaths = [
|
||||
'src/stdlib',
|
||||
@@ -120,6 +123,7 @@ class AtomApplication
|
||||
label: 'Atom'
|
||||
submenu: [
|
||||
{ label: 'About Atom', selector: 'orderFrontStandardAboutPanel:' }
|
||||
{ label: "Version #{getVersion()}", enabled: false }
|
||||
{ type: 'separator' }
|
||||
{ label: 'Preferences...', accelerator: 'Command+,', click: => @openConfig() }
|
||||
{ type: 'separator' }
|
||||
@@ -184,6 +188,9 @@ class AtomApplication
|
||||
ipc.on 'new-window', =>
|
||||
@open()
|
||||
|
||||
ipc.on 'get-version', (event) ->
|
||||
event.result = getVersion()
|
||||
|
||||
sendCommand: (command) ->
|
||||
atomWindow.sendCommand command for atomWindow in @windows when atomWindow.browserWindow.isFocused()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user