コード例 #1
0
ファイル: module.js プロジェクト: pablosole/pet
Module._resolvePath = function(script, parent) {
    var firstTerm = fs.split(script)[0];
    var isRelative = (firstTerm == '.' || firstTerm == '..');
    var parentPath = '';
    if (isRelative) {
        if (parent) {
            parentPath = fs.directory(parent.filename);
        } else { // this will only occur for the root module
            parentPath = fs.workingDirectory();
        }
    } else {
        if (Module.root) {
            parentPath = Module.root;
        } else { // this will only occur for the root module
            parentPath = fs.workingDirectory();
        }
    }
    if (script.indexOf('.js') == -1) {
        return fs.join(parentPath, script+'.js');
    } else {
        return fs.join(parentPath, script);
    }
}
コード例 #2
0
ファイル: testFs.js プロジェクト: samlecuyer/sorrow.js
 testFilesystem_cwd: function() {
     ok(fs.workingDirectory(), 'There should be a cwd');
 }, 
コード例 #3
0
exports["test: getDb(default)"] = function() {
    var got = maps.getDb();
    var exp = fs.join(fs.workingDirectory(), "geoexplorer.db");
    assert.equal(fs.canonical(got), fs.canonical(exp), "db location ./geoexplorer.db by default")
};