Merge pull request #8608 from atom/mb-normalize-driver-letter-case

Normalize drive letter case on windows
This commit is contained in:
Max Brunsfeld 2015-09-01 14:15:39 -07:00
commit 8f1daad4a9
3 changed files with 12 additions and 13 deletions

View File

@ -65,9 +65,6 @@ class AtomApplication
constructor: (options) ->
{@resourcePath, @version, @devMode, @safeMode, @socketPath} = options
# Normalize to make sure drive letter case is consistent on Windows
@resourcePath = path.normalize(@resourcePath) if @resourcePath
global.atomApplication = this
@pidsToOpenWindows = {}

View File

@ -23,9 +23,6 @@ class AtomWindow
locationsToOpen ?= [{pathToOpen}] if pathToOpen
locationsToOpen ?= []
# Normalize to make sure drive letter case is consistent on Windows
@resourcePath = path.normalize(@resourcePath) if @resourcePath
options =
show: false
title: 'Atom'

View File

@ -54,17 +54,20 @@ start = ->
else
path.resolve(pathToOpen)
if args.devMode
AtomApplication = require path.join(args.resourcePath, 'src', 'browser', 'atom-application')
else
AtomApplication = require './atom-application'
AtomApplication = require path.join(args.resourcePath, 'src', 'browser', 'atom-application')
AtomApplication.open(args)
console.log("App load time: #{Date.now() - global.shellStartTime}ms") unless args.test
global.devResourcePath = process.env.ATOM_DEV_RESOURCE_PATH ? path.join(app.getHomeDir(), 'github', 'atom')
# Normalize to make sure drive letter case is consistent on Windows
global.devResourcePath = path.normalize(global.devResourcePath) if global.devResourcePath
normalizeDriveLetterName = (filePath) ->
if process.platform is 'win32'
filePath.replace /^([a-z]):/, ([driveLetter]) -> driveLetter.toUpperCase() + ":"
else
filePath
global.devResourcePath = normalizeDriveLetterName(
process.env.ATOM_DEV_RESOURCE_PATH ? path.join(app.getHomeDir(), 'github', 'atom')
)
setupCrashReporter = ->
crashReporter.start(productName: 'Atom', companyName: 'GitHub')
@ -164,6 +167,8 @@ parseCommandLine = ->
# explicitly pass it by command line, see http://git.io/YC8_Ew.
process.env.PATH = args['path-environment'] if args['path-environment']
resourcePath = normalizeDriveLetterName(resourcePath)
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed,
devMode, safeMode, newWindow, specDirectory, logFile, socketPath, profileStartup}