Skip to content

Conversation

@ignaciosantise
Copy link

@ignaciosantise ignaciosantise commented Jan 4, 2018

Summary

Added option to push to kickoff branch, instead of master. This is useful in cases when the user doesnt have permissions to push directly to master

Screenshot

screen shot 2018-01-04 at 20 44 08

@ignaciosantise
Copy link
Author

Copy link
Contributor

@mvbattan mvbattan left a 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}` }
Copy link
Contributor

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

@mvbattan mvbattan assigned ignaciosantise and unassigned mvbattan Jan 5, 2018
Copy link
Contributor

@wfolini wfolini left a 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

@wfolini wfolini removed their assignment Jan 5, 2018
@IgnacioAbadie IgnacioAbadie removed their assignment Jan 5, 2018
{
type: 'confirm',
name: 'pushToMaster',
message: 'Do you want to push to master?'
Copy link
Contributor

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) {

@sbalay sbalay removed their assignment Jan 8, 2018
@IgnacioAbadie
Copy link
Contributor

@ignaciosantise ? Whats up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants