Skip to content

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

Closed
@fangbinwei

Description

@fangbinwei

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions