kopia lustrzana https://github.com/c9/core
Fixes c9/core+96 - metadata support for ~
rodzic
590e32e62f
commit
5b946753ed
|
@ -457,9 +457,13 @@ module.exports = function setup(fsOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function metadata(path, options, callback) {
|
function metadata(path, options, callback) {
|
||||||
|
if (path.charAt(0) == "~")
|
||||||
|
path = join(process.env.HOME, path.substr(1));
|
||||||
|
|
||||||
var dirpath = (path.substr(0,5) == "/_/_/"
|
var dirpath = (path.substr(0,5) == "/_/_/"
|
||||||
? METAPATH + dirname(path.substr(4))
|
? METAPATH + dirname(path.substr(4))
|
||||||
: WSMETAPATH + "/" + dirname(path));
|
: WSMETAPATH + "/" + dirname(path));
|
||||||
|
|
||||||
resolvePath(dirpath, options, function (err, dir) {
|
resolvePath(dirpath, options, function (err, dir) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
|
|
||||||
|
@ -479,7 +483,11 @@ module.exports = function setup(fsOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMetadata(path, options, callback){
|
function getMetadata(path, options, callback){
|
||||||
|
if (path.charAt(0) == "~")
|
||||||
|
path = join(process.env.HOME, path.substr(1));
|
||||||
|
|
||||||
var metaPath = join(WSMETAPATH, path);
|
var metaPath = join(WSMETAPATH, path);
|
||||||
|
|
||||||
resolvePath(metaPath, options, function (err, path) {
|
resolvePath(metaPath, options, function (err, path) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
fs.readFile(path, callback);
|
fs.readFile(path, callback);
|
||||||
|
|
Ładowanie…
Reference in New Issue