-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
feat: Allow git commit message through UI #1541
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.
Thanks for this PR! I have posted a few comments.
@@ -388,6 +399,8 @@ function formDataFactory () { | |||
return { | |||
folder: '', | |||
force: false, | |||
git: false, |
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.
This should be true
by default to be consistent with the cli behavior.
packages/@vue/cli-ui/locales/en.json
Outdated
@@ -191,7 +191,9 @@ | |||
}, | |||
"options": { | |||
"label": "Additional options", | |||
"description": "Overwrite target folder if it exists" | |||
"description": "Overwrite target folder if it exists", | |||
"git": "Use custom first initial commit message or skip git initialization", |
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.
Let's put "Initialize git repository (recommended)"
.
@@ -281,6 +281,16 @@ async function create (input, context) { | |||
answers.useConfigFiles = 'files' | |||
} | |||
|
|||
const cliOptions = {git: true} | |||
// Git | |||
if (input.skipGit) { |
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.
The name of the variable is wrong, it should be something like enableGit
.
// Git | ||
if (input.skipGit) { | ||
if (!input.gitCommit) { | ||
cliOptions.git = 'false' |
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 be false
.
@@ -37,6 +37,8 @@ input ProjectCreateInput { | |||
remote: Boolean | |||
clone: Boolean | |||
save: String | |||
skipGit: Boolean! |
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.
enableGit
@@ -512,6 +525,8 @@ export default { | |||
input: { | |||
folder: this.formData.folder, | |||
force: this.formData.force, | |||
skipGit: this.formData.git, |
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.
enableGit
Thanks for the review! I added the requested changes. |
a8dc019
to
7e77342
Compare
Implements #1482.
Hi! I went ahead and implemented support on UI to specify a custom initial git commit message and skip git initialization.
I'm not sure if using a single switch for both actions and skip git initialization if the switch is on but no message is specified is the best approach, I can switch to something else like having different switches if it seems a better option.