Skip to content

Support custom initial commit message #1116

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

Merged
merged 3 commits into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@vue/cli-test-utils/assertPromptModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = async function assertPromptModule (
opts = {}
) {
// auto fill non-module prompts
if (opts.plguinsOnly) {
if (opts.pluginsOnly) {
expectedPrompts.unshift(
{
message: 'Please pick a preset',
Expand Down Expand Up @@ -40,7 +40,7 @@ module.exports = async function assertPromptModule (
const creator = new Creator('test', '/', [].concat(module))
const preset = await creator.promptAndResolvePreset()

if (opts.plguinsOnly) {
if (opts.pluginsOnly) {
delete preset.useConfigFiles
}
expect(preset).toEqual(expectedOptions)
Expand Down
1 change: 1 addition & 0 deletions packages/@vue/cli/bin/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ program
.option('-p, --preset <presetName>', 'Skip prompts and use saved or remote preset')
.option('-d, --default', 'Skip prompts and use default preset')
.option('-i, --inlinePreset <json>', 'Skip prompts and use inline JSON string as preset')
.option('-g, --initialCommit <message>', 'Specify initial commit message (when git is available)')
.option('-m, --packageManager <command>', 'Use specified npm client when installing dependencies')
.option('-r, --registry <url>', 'Use specified npm registry when installing dependencies (only for npm)')
.option('-f, --force', 'Overwrite target directory if it exists')
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/Creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ module.exports = class Creator {
await run('git', ['config', 'user.name', 'test'])
await run('git', ['config', 'user.email', '[email protected]'])
}
await run(`git commit -m init`)
await run('git', ['commit', '-m', cliOptions.initialCommit || 'init'])
}

// log instructions
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/promptModules/__tests__/babel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('should pass', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand All @@ -49,6 +49,6 @@ test('should not include the plugin if ts is also present', async () => {
[mockTSModule, moduleToTest],
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ test('CSS pre-processor ', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/promptModules/__tests__/e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('cypress', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand Down Expand Up @@ -57,6 +57,6 @@ test('nightwatch', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
8 changes: 4 additions & 4 deletions packages/@vue/cli/lib/promptModules/__tests__/linter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test('base', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand Down Expand Up @@ -69,7 +69,7 @@ test('airbnb', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand Down Expand Up @@ -101,7 +101,7 @@ test('standard', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand Down Expand Up @@ -133,6 +133,6 @@ test('prettier', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/promptModules/__tests__/pwa.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ test('pwa', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ test('router', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test('with TSLint', async () => {
[moduleToTest, linterModule],
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand Down Expand Up @@ -96,6 +96,6 @@ test('with ESLint', async () => {
[moduleToTest, linterModule],
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/promptModules/__tests__/unit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('mocha', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})

Expand Down Expand Up @@ -57,6 +57,6 @@ test('jest', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/promptModules/__tests__/vuex.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ test('vuex', async () => {
moduleToTest,
expectedPrompts,
expectedOptions,
{ plguinsOnly: true }
{ pluginsOnly: true }
)
})