mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-03-23 19:14:17 +03:00
22 lines
730 B
JavaScript
22 lines
730 B
JavaScript
|
const path = require("path");
|
||
|
const { readdirSync, statSync } = require('fs');
|
||
|
const { execSync } = require("child_process");
|
||
|
|
||
|
const execArgs = { stdio: "inherit", env: process.env };
|
||
|
const command = process.argv.slice(2).join(' ');
|
||
|
|
||
|
const getDirectories = srcPath => readdirSync(srcPath)
|
||
|
.filter(file => statSync(path.join(srcPath, file)).isDirectory());
|
||
|
|
||
|
if (!command) {
|
||
|
console.error('No command specified.')
|
||
|
} else {
|
||
|
const cwd = process.cwd();
|
||
|
getDirectories('packages').forEach(packageName => {
|
||
|
console.log(packageName, path.resolve(__dirname, "../packages/" + packageName));
|
||
|
process.chdir(path.resolve(__dirname, "../packages/" + packageName));
|
||
|
execSync(command, execArgs);
|
||
|
});
|
||
|
process.chdir(cwd);
|
||
|
}
|