Remove $native.absolute()

fs-utils.absolute() now recreates the same behavior
but instead using fs.readpathSync().

This brings over the same behavior for special handling
the /private directory for now.
This commit is contained in:
Kevin Sawicki
2013-03-12 19:41:42 -07:00
parent 426fc7ffc8
commit 65d5e631f8
2 changed files with 17 additions and 13 deletions

View File

@@ -10,7 +10,21 @@ module.exports =
# Make the given path absolute by resolving it against the
# current working directory.
absolute: (path) ->
$native.absolute(path)
return null unless path?
if path.indexOf('~/') is 0
if process.platform is 'win32'
home = process.env.USERPROFILE
else
home = process.env.HOME
path = "#{home}#{path.substring(1)}"
try
path = fs.realpathSync(path)
if process.platform is 'darwin' and path.indexOf('/private/') is 0
path = path.substring(8)
path
catch e
path
# Return the basename of the given path. That is the path with
# any leading directory components removed. If specified, also