Skip to content

Commit

Permalink
Merge pull request #1516 from storybooks/fix/hoist-internals-remove-b…
Browse files Browse the repository at this point in the history
…efore-linking

FIX hoist-internals: remove existing folder/link before linking
  • Loading branch information
ndelangen authored Jul 25, 2017
2 parents 0ceac7d + 9952667 commit b7fb4b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/hoist-internals.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ const task = getLernaPackages()
return path.join(targetPath, packageName);
})
.then(localTargetPath =>
symlink(sourcePath, localTargetPath)
fse
.remove(localTargetPath)
.then(() => symlink(sourcePath, localTargetPath))
.then(
passingLog(() => {
log.silly(prefix, 'symlinked ', [sourcePath, localTargetPath]);
})
)
.then(() => localTargetPath)
.catch(error => {
log.error(prefix, 'symlink', error);
log.error(prefix, 'symlink', error, [sourcePath, localTargetPath]);
throw new Error('failed symlink');
})
)
Expand Down

0 comments on commit b7fb4b3

Please sign in to comment.