2018-09-25 21:49:14 +00:00
|
|
|
const path = require('path');
|
|
|
|
const child_process = require('child_process');
|
|
|
|
|
|
|
|
const moduleName = process.argv[2];
|
|
|
|
if (!moduleName) {
|
|
|
|
console.error("Expected module name");
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
const argString = process.argv.length > 3 ? process.argv.slice(3).join(" ") : "";
|
|
|
|
if (!argString) {
|
2019-03-12 11:06:57 +00:00
|
|
|
console.error("Expected an yarn argument string to use");
|
2018-09-25 21:49:14 +00:00
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
const modulePath = path.dirname(require.resolve(`${moduleName}/package.json`));
|
|
|
|
|
2019-03-12 11:06:57 +00:00
|
|
|
child_process.execSync("yarn " + argString, {
|
2018-09-25 21:49:14 +00:00
|
|
|
env: process.env,
|
|
|
|
cwd: modulePath,
|
2018-09-25 21:54:38 +00:00
|
|
|
stdio: ['inherit', 'inherit', 'inherit'],
|
2018-09-25 21:49:14 +00:00
|
|
|
});
|