1
0
Fork 0

Merge pull request #52 from zachwolf/optional-git

Adds ability to conditionally create a git repo
This commit is contained in:
Travis Fischer 2018-08-15 16:44:29 -05:00 committed by Joost De Cock
parent 534eb109e9
commit fd11c17b98
4 changed files with 34 additions and 12 deletions

View file

@ -15,7 +15,8 @@ const tests = [
repo: 'nala/my-test-library',
license: 'MIT',
manager: 'yarn',
template: 'default'
template: 'default',
git: true
},
{
name: 'my-test-typescript-library',
@ -24,7 +25,8 @@ const tests = [
repo: 'nala/my-test-library',
license: 'MIT',
manager: 'yarn',
template: 'typescript'
template: 'typescript',
git: true
},
{
name: 'my-test-library',
@ -33,7 +35,8 @@ const tests = [
repo: 'nala/my-test-library',
license: 'MIT',
manager: 'npm',
template: 'default'
template: 'default',
git: true
},
{
name: 'my-test-library',
@ -42,7 +45,8 @@ const tests = [
repo: 'nala/my-test-typescript-library',
license: 'MIT',
manager: 'npm',
template: 'typescript'
template: 'typescript',
git: true
},
{
name: '@automagical/nala',
@ -51,7 +55,18 @@ const tests = [
repo: 'superstar-cats/nala',
license: 'GPL',
manager: 'yarn',
template: 'default'
template: 'default',
git: true
},
{
name: 'no-git-library',
author: 'nala',
description: 'this is a auto-generated test module. please ignore.',
repo: 'nala/no-git-library',
license: 'MIT',
manager: 'yarn',
template: 'default',
git: false
},
{
name: 'my-custom-template',
@ -61,7 +76,8 @@ const tests = [
license: 'GPL',
manager: 'yarn',
template: 'custom',
templatePath: './template/default'
templatePath: './template/default',
git: true
}
]
@ -92,8 +108,8 @@ tests.forEach((opts) => {
t.is(ret.code, 0)
// ensure git is initialized properly
ret = await execa.shell('git status', { cwd: root })
t.is(ret.code, 0)
ret = await execa.shell('git rev-parse --git-dir', { cwd: root })
t.is(ret.stdout, opts.git ? '.git' : path.join(process.cwd(), '.git'))
await rmfr(root)
})