diff --git a/src/atom-application.coffee b/src/atom-application.coffee index e2cf98ad7..a2c48b3d6 100644 --- a/src/atom-application.coffee +++ b/src/atom-application.coffee @@ -1,4 +1,4 @@ -AtomWindow = require 'atom-window' +AtomWindow = require './atom-window' BrowserWindow = require 'browser_window' Menu = require 'menu' app = require 'app' diff --git a/src/atom-window.coffee b/src/atom-window.coffee index b487fdd16..c9f7f2af3 100644 --- a/src/atom-window.coffee +++ b/src/atom-window.coffee @@ -6,7 +6,7 @@ class AtomWindow browserWindow: null constructor: ({bootstrapScript, resourcePath, @pathToOpen, exitWhenDone, @isSpec}) -> - require('atom-application').addWindow(this) + require('./atom-application').addWindow(this) @browserWindow = new BrowserWindow show: false, title: 'Atom' @handleEvents() @@ -19,7 +19,7 @@ class AtomWindow handleEvents: -> @browserWindow.on 'destroyed', => - require('atom-application').removeWindow(this) + require('./atom-application').removeWindow(this) if @isSpec # Spec window's web view should always have focus diff --git a/src/main.coffee b/src/main.coffee index 4cf71390c..3af69df4a 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -3,19 +3,16 @@ path = require 'path' delegate = require 'atom_delegate' optimist = require 'optimist' nslog = require('nslog') +AtomApplication = require('./atom-application') console.log = (args...) -> nslog(args.map((arg) -> JSON.stringify(arg)).join(" ")) require 'coffee-script' -atomApplication = null - delegate.browserMainParts.preMainMessageLoopRun = -> commandLineArgs = parseCommandLine() - require('module').globalPaths.push(path.join(commandLineArgs.resourcePath, 'src')) - AtomApplication = require('atom-application') - atomApplication = new AtomApplication(commandLineArgs) + new AtomApplication(commandLineArgs) getHomeDir = -> process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']