From 5b946753edd48f94e9f4524e49b54309410d7a60 Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Wed, 28 Oct 2015 14:41:55 -0700 Subject: [PATCH] Fixes c9/core+96 - metadata support for ~ --- node_modules/vfs-local/localfs.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node_modules/vfs-local/localfs.js b/node_modules/vfs-local/localfs.js index d281ba80..760c7299 100644 --- a/node_modules/vfs-local/localfs.js +++ b/node_modules/vfs-local/localfs.js @@ -457,9 +457,13 @@ module.exports = function setup(fsOptions) { } function metadata(path, options, callback) { + if (path.charAt(0) == "~") + path = join(process.env.HOME, path.substr(1)); + var dirpath = (path.substr(0,5) == "/_/_/" ? METAPATH + dirname(path.substr(4)) : WSMETAPATH + "/" + dirname(path)); + resolvePath(dirpath, options, function (err, dir) { if (err) return callback(err); @@ -479,7 +483,11 @@ module.exports = function setup(fsOptions) { } function getMetadata(path, options, callback){ + if (path.charAt(0) == "~") + path = join(process.env.HOME, path.substr(1)); + var metaPath = join(WSMETAPATH, path); + resolvePath(metaPath, options, function (err, path) { if (err) return callback(err); fs.readFile(path, callback);