Skip to content
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

cli-test-utils can't create project without git #4223

Closed
fangbinwei opened this issue Jul 2, 2019 · 0 comments · Fixed by #4224
Closed

cli-test-utils can't create project without git #4223

fangbinwei opened this issue Jul 2, 2019 · 0 comments · Fixed by #4224

Comments

@fangbinwei
Copy link
Collaborator

fangbinwei commented Jul 2, 2019

Version

4.0.0-alpha.1

Environment info

System:
    OS: macOS 10.14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 11.12.0 - ~/.nvm/versions/node/v11.12.0/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.7.0 - ~/.nvm/versions/node/v11.12.0/bin/npm
  Browsers:
    Chrome: 75.0.3770.100
    Firefox: Not Found
    Safari: 12.1.1
  npmGlobalPackages:
    @vue/cli: 3.8.4

Steps to reproduce

const create = require('@vue/cli-test-utils/createTestProject')
const path = require('path')

test('should work', async () => {
  const project = await create('test-no-git', {
    plugins: {
      '@vue/cli-plugin-babel': {}
    }
  },
  path.resolve(__dirname, '../../test'),
  false // initGit
) 
})

What is expected?

create a project without git

What is actually happening?

git init

It seems vue create test_project --git false is deprecated.

const args = [
'create',
name,
'--force',
'--inlinePreset',
JSON.stringify(preset),
'--git',
initGit ? 'init' : 'false'
]

so, the code maybe should be like this (created a pull request)

  const args = [
    'create',
    name,
    '--force',
    '--inlinePreset',
    JSON.stringify(preset),
    initGit ? '--git' : '--no-git'
  ]

this commit is relevant
967f99a#diff-91d463c4e556ce82ad6c40523a7629b4

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 a pull request may close this issue.

1 participant