mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Make detect order of resourcePath more robust.
1. Use the resource-path of process.argv if specified; 2. Otherwise if --dev is specified then use ~/github/atom; 3. If no valid resourcePath is provide use the ones in bundle.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
optimist = require 'optimist'
|
||||
delegate = require 'atom_delegate'
|
||||
@@ -7,9 +8,6 @@ executedFrom = null
|
||||
pathsToOpen = null
|
||||
atomApplication = null
|
||||
|
||||
|
||||
require('fs').writeFileSync('/Users/corey/Desktop/moo.txt', process.cwd())
|
||||
|
||||
getHomeDir = ->
|
||||
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
|
||||
|
||||
@@ -38,7 +36,16 @@ parseCommandLine = ->
|
||||
executedFrom = args['executed-from']
|
||||
devMode = args['dev']
|
||||
pathsToOpen = args._
|
||||
resourcePath = if devMode then path.join(getHomeDir(), 'github/atom') else path.dirname(__dirname)
|
||||
|
||||
if args['resource-path']
|
||||
resourcePath = args['resource-path']
|
||||
else if devMode
|
||||
resourcePath = path.join(getHomeDir(), 'github/atom')
|
||||
|
||||
try
|
||||
fs.statSync resourcePath
|
||||
catch e
|
||||
resourcePath = path.dirname(__dirname)
|
||||
|
||||
bootstrapApplication = ->
|
||||
parseCommandLine()
|
||||
|
||||
Reference in New Issue
Block a user