Skip to content
This repository has been archived by the owner on Aug 1, 2018. It is now read-only.

Commit

Permalink
Bug Fixes: Added support for multiple labels
Browse files Browse the repository at this point in the history
Multiple labels with comma separated value

Signed-Off-By: Progyan Bhatatcharya <[email protected]>
  • Loading branch information
0xTheProDev committed May 16, 2017
1 parent 3bdb0c5 commit 18d251b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ branches:
install:
- npm install --ignore-scripts
- npm link
- export NODEJS_ENV=development
script:
- npm test
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const argv = process.argv,
GHT = require('./lib/ght.js'),
ver = require('./package.json').version,

DIR = process.env.NODEJS_ENV == 'development' ? __dirname : '~',
DIR = process.env.NODEJS_ENV == 'development' ? __dirname : (process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE),
CONFIG = path.resolve(DIR, '.ghb'),
FILE = curDir.replace(/[|&:;$%@"<>()+,\/\\\s]/g, '-'),
FILE = curDir.replace(/[|&:;$%@"<>()+,\/\\\s]+/g, '-'),

helpStr =
`Usage: ghb [options] [parameter]
Expand Down
6 changes: 4 additions & 2 deletions lib/fetchissue.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ var fetchIssue = (config, flag, callback) => {
fg = '?state=' + flag.value
else if (flag.key === 'id' && typeof flag.value == 'number')
fg = '/' + flag.value.toString()
else if (flag.key === 'label' && typeof flag.value === 'string')
fg = '?labels=' + flag.value.replace(/[\s]/, '+')
else if (flag.key === 'label' && typeof flag.value === 'string'){
let temp = flag.value.replace(/([,])[\s]/, ',')
fg = '?labels=' + temp.replace(/[\s]/, '+')
}
else {
let err = `Invalid argument specified for fetch issue.`
throw err;
Expand Down
6 changes: 4 additions & 2 deletions lib/fetchpulls.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ var fetchPulls = (config, flag, callback) => {
fg = '?state=' + flag.value
else if (flag.key === 'id' && typeof flag.value == 'number')
fg = '/' + flag.value.toString()
else if (flag.key === 'label' && typeof flag.value === 'string')
fg = '?labels=' + flag.value.replace(/[\s]/, '+')
else if (flag.key === 'label' && typeof flag.value === 'string'){
let temp = flag.value.replace(/([,])[\s]/, ',')
fg = '?labels=' + temp.replace(/[\s]/, '+')
}
else {
let err = `Invalid argument specified for fetch pulls.`
throw err;
Expand Down

0 comments on commit 18d251b

Please sign in to comment.