-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81bf6f3
commit deca496
Showing
6 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
|
||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
*.log | ||
*.dump | ||
*.swp | ||
.DS_Store | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- 6 | ||
- 4 | ||
- '0.12' | ||
before_script: | ||
- npm prune | ||
after_success: | ||
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all' | ||
- python travis_after_all.py | ||
- 'export $(cat .to_export_back) &> /dev/null' | ||
- npm run semantic-release | ||
branches: | ||
except: | ||
- "/^v\\d+\\.\\d+\\.\\d+$/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# @greenkeeper/flags | ||
|
||
[![Build Status](https://travis-ci.org/greenkeeperio/flags.svg?branch=master)](https://travis-ci.org/greenkeeperio/flags) | ||
[![Dependency Status](https://david-dm.org/greenkeeperio/flags/master.svg)](https://david-dm.org/greenkeeperio/flags/master) | ||
[![devDependency Status](https://david-dm.org/greenkeeperio/flags/master/dev-status.svg)](https://david-dm.org/greenkeeperio/flags/master#info=devDependencies) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | ||
|
||
option parsing for Greenkeeper CLI tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var url = require('url') | ||
|
||
var _ = require('lodash') | ||
var nerfDart = require('nerf-dart') | ||
var nopt = require('nopt') | ||
|
||
var rc = require('@greenkeeper/rc') | ||
|
||
var types = { | ||
api: String, | ||
help: Boolean, | ||
organization: String, | ||
postpublish: Boolean, | ||
private: Boolean, | ||
slug: String, | ||
version: Boolean, | ||
loglevel: [ | ||
'error', | ||
'http', | ||
'info', | ||
'silent', | ||
'silly', | ||
'verbose', | ||
'warn' | ||
] | ||
} | ||
|
||
var rcFlags = rc.get() | ||
nopt.clean(rcFlags, types) | ||
|
||
var cliFlags = nopt(types, { | ||
h: '--help', | ||
usage: '--help', | ||
v: '--version', | ||
s: ['--loglevel', 'silent'], | ||
d: ['--loglevel', 'info'], | ||
dd: ['--loglevel', 'verbose'], | ||
ddd: ['--loglevel', 'silly'], | ||
silent: ['--loglevel', 'silent'], | ||
verbose: ['--loglevel', 'verbose'], | ||
quiet: ['--loglevel', 'warn'] | ||
}) | ||
|
||
var flags = module.exports = _.assign({}, rcFlags, cliFlags) | ||
|
||
flags.api = url.parse(flags.api || 'https://api.greenkeeper.io/').format() | ||
flags.token = rc.get()[nerfDart(flags.api) + 'token'] || flags.token | ||
flags.postpublish = flags.hasOwnProperty('postpublish') | ||
? flags.postpublish | ||
: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@greenkeeper/flags", | ||
"description": "option parsing for Greenkeeper CLI tools", | ||
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)", | ||
"bugs": { | ||
"url": "https://github.com/greenkeeperio/flags/issues" | ||
}, | ||
"dependencies": { | ||
"@greenkeeper/rc": "^1.0.0", | ||
"lodash": "^4.11.1", | ||
"nerf-dart": "^1.0.0", | ||
"nopt": "^3.0.6" | ||
}, | ||
"devDependencies": { | ||
"standard": "^6.0.8", | ||
"greenkeeper-postpublish": "^1.0.0", | ||
"semantic-release": "^4.3.5" | ||
}, | ||
"homepage": "https://greenkeeper.io", | ||
"license": "Apache-2.0", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/greenkeeperio/flags.git" | ||
}, | ||
"scripts": { | ||
"test": "standard", | ||
"postpublish": "greenkeeper-postpublish", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |