Skip to content

Commit

Permalink
fix linking package.json reading, and directories flattening behaviou…
Browse files Browse the repository at this point in the history
…rs (#416)
  • Loading branch information
guybedford committed Jan 30, 2015
1 parent 0cf5511 commit 8553d98
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/link.js
Expand Up @@ -71,10 +71,14 @@ exports.link = function(name, dir, force) {
// create it
.then(function() {
if (pjson.directories) {
if (pjson.directories.dist)
dir = path.resolve(dir, pjson.directories.dist);
else if (pjson.directories.lib)
if (pjson.directories.lib) {
dir = path.resolve(dir, pjson.directories.lib);
delete pjson.directories.lib;
}
if (pjson.directories.dist) {
dir = path.resolve(dir, pjson.directories.dist);
delete pjson.directories.dist;
}
}

return asp(mkdirp)(linkDir);
Expand Down Expand Up @@ -182,7 +186,7 @@ exports.symlink = function(pkg, downloadDeps) {
return asp(fs.symlink)(linkDir, dir, 'dir');
})
.then(function() {
return readJSON(path.resolve(dir, 'package.json'));
return readJSON(path.resolve(dir, '.jspm.json'));
})
.then(function(_pjson) {
pjson = config.derivePackageConfig(_pjson);
Expand Down

0 comments on commit 8553d98

Please sign in to comment.