The browser process loads files from the resource path in dev mode

main.coffee is the only exception
This commit is contained in:
probablycorey 2013-08-21 14:41:31 -07:00
parent 9306c9b262
commit 0d74753d3e
2 changed files with 10 additions and 5 deletions

View File

@ -1,5 +1,5 @@
AtomWindow = require './atom-window'
ApplicationMenu = require './application-menu'
AtomWindow = require 'atom-window'
ApplicationMenu = require 'application-menu'
BrowserWindow = require 'browser-window'
Menu = require 'menu'
autoUpdater = require 'auto-updater'

View File

@ -1,4 +1,3 @@
AtomApplication = require './atom-application'
autoUpdater = require 'auto-updater'
crashReporter = require 'crash-reporter'
delegate = require 'atom-delegate'
@ -13,8 +12,6 @@ _ = require 'underscore'
console.log = (args...) ->
nslog(args.map((arg) -> JSON.stringify(arg)).join(" "))
require 'coffee-script'
delegate.browserMainParts.preMainMessageLoopRun = ->
args = parseCommandLine()
@ -45,6 +42,14 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
args.pathsToOpen = args.pathsToOpen.map (pathToOpen) ->
path.resolve(args.executedFrom ? process.cwd(), pathToOpen)
if args.devMode
require('coffee-script')
require('coffee-cache').setCacheDir('/tmp/atom-coffee-cache')
require('module').globalPaths.push(args.resourcePath + "/src")
AtomApplication = require 'atom-application'
else
AtomApplication = require './atom-application'
AtomApplication.open(args)
global.devResourcePath = path.join(app.getHomeDir(), 'github', 'atom')