Skip to content

Commit

Permalink
#20 - Option to remove custom JSON preset
Browse files Browse the repository at this point in the history
  • Loading branch information
codenameyau committed Jun 14, 2015
1 parent 982eaa0 commit 0885620
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export GITHUB_LABEL_TOKEN='REPLACE THIS WITH YOUR TOKEN'
```

## Usage Examples
Here a few examples. See the [presets directory](https://github.com/codenameyau/github-label/tree/master/presets)
Here a few examples. The quotes are optional.
See the [presets directory](https://github.com/codenameyau/github-label/tree/master/presets)
for a list of available predefined label presets.

##### Output current labels
Expand All @@ -37,7 +38,17 @@ github-label 'codenameyau/github-label'
github-label 'codenameyau/github-label' -p priority
```

##### Create labels by specifying your own JSON preset
##### Remove label preset
```
github-label 'codenameyau/github-label' -p priority -r
```

##### Create labels by specifying your own custom JSON preset
```
github-label 'codenameyau/github-label' -j 'path-to/preset.json'
```

##### Remove custom label preset
```
github-label 'codenameyau/github-label' -j 'path-to/preset.json' -r
```
6 changes: 5 additions & 1 deletion bin/github-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ if (!repository) {
// Read JSON file if specfied by user.
if (jsonFile) {
utils.readJSON(jsonFile, function(data) {
sendClientRequest(repository, data, createLabels);
if (removePreset) {
sendClientRequest(repository, data, removeLabels);
} else {
sendClientRequest(repository, data, createLabels);
}
});
}

Expand Down

0 comments on commit 0885620

Please sign in to comment.