codemods: fix for --dry flag not being hooked up
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -36,9 +36,18 @@ export function createCodemodAction(name: string) {
|
||||
'--transform',
|
||||
transformPath,
|
||||
'--ignore-pattern=**/node_modules/**',
|
||||
...(cmd.args.length ? cmd.args : ['.']),
|
||||
];
|
||||
|
||||
if (cmd.dry) {
|
||||
args.push('--dry');
|
||||
}
|
||||
|
||||
if (cmd.args.length) {
|
||||
args.push(...cmd.args);
|
||||
} else {
|
||||
args.push('.');
|
||||
}
|
||||
|
||||
console.log(`Running jscodeshift with these arguments: ${args.join(' ')}`);
|
||||
|
||||
const jscodeshiftScript = require.resolve('.bin/jscodeshift');
|
||||
|
||||
Reference in New Issue
Block a user