mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Install atom executable during window.startup()
Previously this was done during `rake install`. Also default to `~/github/atom` as the default resource path when no `--resource-path` argument is specified. This argument will now be required when running in dev mode if the repository is not at the default location. Closes #300
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
fs = require 'fs'
|
||||
$ = require 'jquery'
|
||||
ChildProcess = require 'child-process'
|
||||
require 'jquery-extensions'
|
||||
require 'underscore-extensions'
|
||||
require 'space-pen-extensions'
|
||||
@@ -39,6 +40,7 @@ window.setUpEnvironment = ->
|
||||
|
||||
# This method is only called when opening a real application window
|
||||
window.startup = ->
|
||||
installAtomCommand('/opt/github/bin/atom')
|
||||
handleWindowEvents()
|
||||
config.load()
|
||||
atom.loadTextPackage()
|
||||
@@ -65,6 +67,14 @@ window.shutdown = ->
|
||||
window.rootView = null
|
||||
window.project = null
|
||||
|
||||
window.installAtomCommand = (commandPath) ->
|
||||
return if fs.exists(commandPath)
|
||||
|
||||
bundledCommandPath = fs.resolve(window.resourcePath, 'atom.sh')
|
||||
if bundledCommandPath?
|
||||
fs.write(commandPath, fs.read(bundledCommandPath))
|
||||
ChildProcess.exec("chmod u+x '#{commandPath}'")
|
||||
|
||||
window.handleWindowEvents = ->
|
||||
$(window).on 'core:close', => window.close()
|
||||
$(window).command 'window:close', => window.close()
|
||||
|
||||
Reference in New Issue
Block a user