-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dryRun flag to CodeTransform invocations #613
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor things.
`Code transform ${italic(editorName)} made no changes to ${bold(slug)}`)); | ||
} else if (isDryRun(params)) { | ||
const gitDiffResult = await execPromise("git", ["diff"], { cwd: project.baseDir }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably wrap in a try/catch block to be safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
1cd85ab
to
0dc8340
Compare
9befa81
to
6d49b8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This adds a new parameter to the invocation of
CodeTransforms
: When specifieddryRun=true
the transform will not commit its changes and instead the git diff will get sent back to the person invoking the command.This is useful for testing transforms across a large set of the repos.
Oh, and cleaned up a couple of unused imports.