Skip to content

Commit

Permalink
support remove individual module
Browse files Browse the repository at this point in the history
  • Loading branch information
liziqiang committed Feb 19, 2020
1 parent fd2c04f commit 47f1a73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yarn-linked",
"version": "1.1.7",
"version": "1.1.8",
"description": "List or remove yarn linked modules",
"bin": {
"yarn-linked": "yarn-linked.js"
Expand Down
6 changes: 3 additions & 3 deletions yarn-linked.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const command_handlers = {
}
},
// only remove top level linked modules
removeLinked(cwd) {
removeLinked(cwd, module) {
const modules = path.join(cwd, NODE_MODULES);
const linked = getLinked(modules);
const linked = getLinked(modules).filter((v) => module ? v === module : true);
if (linked.length) {
const tasks = linked.map((link) => {
return {
Expand Down Expand Up @@ -74,5 +74,5 @@ const _func = command_handlers[`${cmd}Linked`];
if (!_func) {
yargs.showHelp();
} else {
_func.call(command_handlers, cwd);
_func.call(command_handlers, cwd, argv._.shift());
}

0 comments on commit 47f1a73

Please sign in to comment.