Skip to content

Commit

Permalink
feat: make appveyor optional (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumDenby authored and jdx committed Aug 17, 2018
1 parent 30c6aff commit 74d17c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/generators/app.ts
Expand Up @@ -42,6 +42,7 @@ class App extends Generator {
defaults?: boolean
mocha: boolean
circleci: boolean
appveyor: boolean
codecov: boolean
'semantic-release': boolean
typescript: boolean
Expand All @@ -66,6 +67,7 @@ class App extends Generator {
options: {
mocha: boolean
circleci: boolean
appveyor: boolean
codecov: boolean
typescript: boolean
tslint: boolean
Expand All @@ -75,6 +77,7 @@ class App extends Generator {
}
mocha!: boolean
circleci!: boolean
appveyor!: boolean
codecov!: boolean
semantic_release!: boolean
ts!: boolean
Expand All @@ -97,6 +100,7 @@ class App extends Generator {
defaults: opts.defaults,
mocha: opts.options.includes('mocha'),
circleci: opts.options.includes('circleci'),
appveyor: opts.options.includes('appveyor'),
codecov: opts.options.includes('codecov'),
'semantic-release': opts.options.includes('semantic-release'),
typescript: opts.options.includes('typescript'),
Expand Down Expand Up @@ -231,6 +235,7 @@ class App extends Generator {
{name: 'yarn (npm alternative)', value: 'yarn', checked: this.options.yarn || hasYarn},
{name: 'mocha (testing framework)', value: 'mocha', checked: true},
{name: 'circleci (continuous integration/delivery service)', value: 'circleci', checked: true},
{name: 'appveyor (continuous integration/delivery service)', value: 'appveyor', checked: true},
{name: 'codecov (online code coverage report viewer)', value: 'codecov', checked: true},
{name: 'typescript (static typing for javascript)', value: 'typescript', checked: true},
{name: 'tslint (static analysis tool for typescript)', value: 'tslint', checked: true},
Expand All @@ -254,6 +259,7 @@ class App extends Generator {
this.yarn = this.options.yarn
this.mocha = this.options.mocha
this.circleci = this.options.circleci
this.appveyor = this.options.appveyor
this.codecov = this.options.codecov
this.semantic_release = this.options['semantic-release']

Expand Down Expand Up @@ -373,8 +379,10 @@ class App extends Generator {
// this.fs.copyTpl(this.templatePath('scripts/setup_git'), this.destinationPath('.circleci/setup_git'), this)
this.fs.copyTpl(this.templatePath('circle.yml.ejs'), this.destinationPath('.circleci/config.yml'), this)
}
if (this.appveyor) {
this.fs.copyTpl(this.templatePath('appveyor.yml.ejs'), this.destinationPath('appveyor.yml'), this)
}
this.fs.copyTpl(this.templatePath('README.md.ejs'), this.destinationPath('README.md'), this)
this.fs.copyTpl(this.templatePath('appveyor.yml.ejs'), this.destinationPath('appveyor.yml'), this)
if (this.pjson.license === 'MIT' && (this.pjson.repository.startsWith('oclif') || this.pjson.repository.startsWith('heroku'))) {
this.fs.copyTpl(this.templatePath('LICENSE.mit'), this.destinationPath('LICENSE'), this)
}
Expand Down
4 changes: 3 additions & 1 deletion templates/README.md.ejs
Expand Up @@ -5,10 +5,12 @@

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/<%= pjson.name %>.svg)](https://npmjs.org/package/<%= pjson.name %>)
<% if(circleci) { %>
<% if (circleci) { %>
[![CircleCI](https://circleci.com/gh/<%= repository %>/tree/master.svg?style=shield)](https://circleci.com/gh/<%= repository %>/tree/master)
<% } %>
<% if (appveyor) { %>
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/<%= repository %>?branch=master&svg=true)](https://ci.appveyor.com/project/<%= repository %>/branch/master)
<% } %>
<% if (codecov) { %>
[![Codecov](https://codecov.io/gh/<%= repository %>/branch/master/graph/badge.svg)](https://codecov.io/gh/<%= repository %>)
<% } %>
Expand Down

0 comments on commit 74d17c1

Please sign in to comment.