Resolve bootstrap scripts against dev resource path

This commit is contained in:
Kevin Sawicki
2013-09-20 11:04:52 -07:00
parent 6a0fcc9330
commit 571bf5f9ea
2 changed files with 11 additions and 3 deletions

View File

@@ -276,13 +276,21 @@ class AtomApplication
if resourcePath isnt @resourcePath and not fs.existsSync(resourcePath)
resourcePath = @resourcePath
bootstrapScript = require.resolve('../spec/spec-bootstrap')
try
bootstrapScript = require.resolve(path.resolve(global.devResourcePath, 'spec', 'spec-bootstrap'))
catch error
bootstrapScript = require.resolve(path.resolve(__dirname, '..', 'spec', 'spec-bootstrap'))
isSpec = true
devMode = true
new AtomWindow({bootstrapScript, resourcePath, exitWhenDone, isSpec, devMode, specDirectory})
runBenchmarks: ->
bootstrapScript = 'benchmark/benchmark-bootstrap'
try
bootstrapScript = require.resolve(path.resolve(global.devResourcePath, 'benchmark', 'benchmark-bootstrap'))
catch error
bootstrapScript = require.resolve(path.resolve(__dirname, '..', 'benchmark', 'benchmark-bootstrap'))
isSpec = true # Needed because this flag adds the spec directory to the NODE_PATH
new AtomWindow({bootstrapScript, @resourcePath, isSpec})

View File

@@ -42,8 +42,8 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
args.pathsToOpen = args.pathsToOpen.map (pathToOpen) ->
path.resolve(args.executedFrom ? process.cwd(), pathToOpen)
require('coffee-script')
if args.devMode
require('coffee-script')
require(path.join(args.resourcePath, 'src', 'coffee-cache'))
require('module').globalPaths.push(path.join(args.resourcePath, 'src'))
else