Normalize opened paths to handle ~

Closes #3829
This commit is contained in:
Kevin Sawicki
2015-02-04 16:38:40 -08:00
parent 9618ec45cf
commit c5b6b90c88
3 changed files with 7 additions and 5 deletions

View File

@@ -31,7 +31,7 @@
"emissary": "^1.3.1",
"event-kit": "^1.0.2",
"first-mate": "^3.0.0",
"fs-plus": "^2.3.2",
"fs-plus": "^2.5",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^3.0.0",

View File

@@ -5,7 +5,7 @@ AutoUpdateManager = require './auto-update-manager'
BrowserWindow = require 'browser-window'
Menu = require 'menu'
app = require 'app'
fs = require 'fs'
fs = require 'fs-plus'
ipc = require 'ipc'
path = require 'path'
os = require 'os'
@@ -342,6 +342,7 @@ class AtomApplication
# :window - {AtomWindow} to open file paths in.
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, window}={}) ->
{pathToOpen, initialLine, initialColumn} = @locationForPathToOpen(pathToOpen)
pathToOpen = fs.normalize(pathToOpen)
unless pidToKillWhenClosed or newWindow
pathToOpenStat = fs.statSyncNoException(pathToOpen)

View File

@@ -2,7 +2,7 @@ global.shellStartTime = Date.now()
crashReporter = require 'crash-reporter'
app = require 'app'
fs = require 'fs'
fs = require 'fs-plus'
path = require 'path'
optimist = require 'optimist'
nslog = require 'nslog'
@@ -43,10 +43,11 @@ start = ->
cwd = args.executedFrom?.toString() or process.cwd()
args.pathsToOpen = args.pathsToOpen.map (pathToOpen) ->
pathToOpen = fs.normalize(pathToOpen)
if cwd
path.resolve(cwd, pathToOpen.toString())
path.resolve(cwd, pathToOpen)
else
path.resolve(pathToOpen.toString())
path.resolve(pathToOpen)
setupCoffeeScript()
if args.devMode