-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review comments: Move targetList to common helper
Add provision to get cli args when src/cli.js is run separately
- Loading branch information
1 parent
f16e437
commit a08dfc6
Showing
3 changed files
with
45 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const targetList = new Set([ | ||
"acorn", | ||
"babel", | ||
"babylon", | ||
"buble", | ||
"chai", | ||
"coffeescript", | ||
"espree", | ||
"esprima", | ||
"jshint", | ||
"lebab", | ||
"prepack", | ||
"prettier", | ||
"source-map", | ||
"typescript", | ||
"uglify-es", | ||
"uglify-js" | ||
]); | ||
|
||
function getOnlyFlag(argv) { | ||
if (process.argv.indexOf("--only") != -1) { | ||
return process.argv[process.argv.indexOf("--only") + 1]; | ||
} | ||
} | ||
|
||
module.exports = { | ||
getTarget: function() { | ||
let onlyArg = getOnlyFlag(); | ||
if (targetList.has(onlyArg)) { | ||
return [onlyArg]; | ||
} else if (typeof ONLY != "undefined" && targetList.has(ONLY)) { | ||
return [ONLY]; | ||
} else { | ||
return [...targetList]; | ||
} | ||
}, | ||
targetList: targetList | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters