mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[rrm] Add logging to execInRepo, dry-run option
This commit is contained in:
committed by
Dan Abramov
parent
a9035c1e4e
commit
a68ca21469
@@ -19,6 +19,9 @@ const vorpal = new Vorpal();
|
||||
// TODO: Make this an argument to the script
|
||||
const PATH_TO_REPO = path.resolve('../../../react');
|
||||
|
||||
// Quick dry run opt-in. This allows quick debugging of execInRepo without
|
||||
// actually running the command, ensuring no accidental publishing.
|
||||
const DRY_RUN = false;
|
||||
|
||||
|
||||
// HELPERS
|
||||
@@ -33,6 +36,12 @@ function writeTo(file, data) {
|
||||
|
||||
// Wrapper around exec so we don't have to worry about paths
|
||||
function execInRepo(command) {
|
||||
vorpal.log(chalk.gray(`Executing ${chalk.underline(command)}`));
|
||||
|
||||
if (DRY_RUN) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return execSync(command, {
|
||||
cwd: PATH_TO_REPO,
|
||||
encoding: 'utf8',
|
||||
|
||||
Reference in New Issue
Block a user