Skip to content

Commit

Permalink
Merge pull request #45 from gregpabian/dereference
Browse files Browse the repository at this point in the history
dereference option
  • Loading branch information
AvianFlu committed Sep 24, 2014
2 parents 8c72534 + 4f4c1e7 commit d2427ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ncp.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ function ncp (source, dest, options, callback) {
}

function checkLink(resolvedPath, target) {
if (dereference) {
resolvedPath = path.resolve(basePath, resolvedPath);
}
isWritable(target, function (writable) {
if (writable) {
return makeLink(resolvedPath, target);
Expand All @@ -177,6 +180,9 @@ function ncp (source, dest, options, callback) {
if (err) {
return onError(err);
}
if (dereference) {
targetDest = path.resolve(basePath, targetDest);
}
if (targetDest === resolvedPath) {
return cb();
}
Expand Down

0 comments on commit d2427ec

Please sign in to comment.