-
Notifications
You must be signed in to change notification settings - Fork 13
Added option to push to another branch #55
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
base: master
Are you sure you want to change the base?
Conversation
mvbattan
left a comment
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.
git command may fail due missing credentials (e.g. a SSH key), connectivity, etc.
I'd like to define the behavior of this generator while encountering a failure.
| command: [ | ||
| 'git', | ||
| ['push', 'origin', 'master'], | ||
| { cwd: `${process.cwd()}/${this.projectName}` } |
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.
I'd extract this command as a function that receives the branch name
wfolini
left a comment
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.
Excellent!
I'd add another change also. The problem is when you create the branch kickoff. If you create this branch setting the remote url without clone the repo, you cant create the pull request because will not find matches between branches. The solution is change this piece of code...
command: [
'git',
['remote', 'add', 'origin', repoUrl],
{ cwd: `${process.cwd()}/${this.projectName}` }
]
Change it to a command that clones the repository instead of that command
| { | ||
| type: 'confirm', | ||
| name: 'pushToMaster', | ||
| message: 'Do you want to push to master?' |
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.
Instead of asking: push to master? I'd change this to ask which branch do you want to use? and use master as default value.
That way the branch to use is customizable and we dont need if (!pushToMaster) {
|
@ignaciosantise ? Whats up? |
Summary
Added option to push to
kickoffbranch, instead ofmaster. This is useful in cases when the user doesnt have permissions to push directly tomasterScreenshot