mirror of
https://github.com/atom/atom.git
synced 2026-02-18 10:31:54 -05:00
Make paths absolute before calling $native.watchPath
Also return a subscription that can be unwatched instead of returning an id that is later passed to $native.unwatchPath along with the watched path. This allows specs to pass when run from a symlink'ed folder.
This commit is contained in:
@@ -19,10 +19,7 @@ module.exports =
|
||||
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
|
||||
fs.realpathSync(path)
|
||||
catch e
|
||||
path
|
||||
|
||||
@@ -285,3 +282,8 @@ module.exports =
|
||||
cson.readObject(path)
|
||||
else
|
||||
@readPlist(path)
|
||||
|
||||
watchPath: (path, callback) ->
|
||||
path = @absolute(path)
|
||||
id = $native.watchPath(path, callback)
|
||||
unwatch: -> $native.unwatchPath(path, id)
|
||||
|
||||
Reference in New Issue
Block a user