Skip to content

Commit

Permalink
Show badges based on conditions
Browse files Browse the repository at this point in the history
- Show "npm"-badge only for non-private packages
- Show "coveralls" and "travis" only if ".travis.yml" exists
  (This is not perfect for "coveralls", but it is currently much easier than parsing the '.travis.yml'
  for the coveralls-script)
  • Loading branch information
Nils Knappmeier committed Jan 12, 2016
1 parent 1bbdc8f commit f9b117e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions handlebars/templates/README.md.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# {{{package.name}}}
[![NPM version](https://badge.fury.io/js/{{package.name}}.svg)](http://badge.fury.io/js/{{package.name}})
[![Build Status](https://travis-ci.org/nknapp/{{package.name}}.svg)](https://travis-ci.org/nknapp/{{package.name}})
[![Coverage Status](https://img.shields.io/coveralls/nknapp/{{package.name}}.svg)](https://coveralls.io/r/nknapp/{{package.name}})

{{#unless package.private~}}
[![NPM version](https://badge.fury.io/js/{{package.name}}.svg)](http://badge.fury.io/js/{{package.name}})
{{/unless}}
{{#if ( exists '.travis.yml' ) }}
[![Build Status](https://travis-ci.org/nknapp/{{package.name}}.svg)](https://travis-ci.org/nknapp/{{package.name}})
[![Coverage Status](https://img.shields.io/coveralls/nknapp/{{package.name}}.svg)](https://coveralls.io/r/nknapp/{{package.name}})
{{/if}}

> {{{package.description}}}

Expand Down

0 comments on commit f9b117e

Please sign in to comment.