Skip to content

Commit

Permalink
Merge branch 'master' of github.com:huan/pkg-jq
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Jun 20, 2019
2 parents 2fbb9e1 + 2a64519 commit d00926e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Optional arguments:
-h, --help Show this help message and exit.
-v, --version Show programs version number and exit.
-i, --in-place edit files in place.
-r output raw strings, not JSON texts.
-r, --raw output raw strings, not JSON texts.


Exmaple: pkg-jq -i '.publishConfig.tag="next"'
Expand All @@ -48,8 +48,7 @@ $ grep version package.json
$ pkg-jq .version
"0.0.6"

// Raw mode:

# Raw mode: -r
$ pkg-jq -r .version
0.0.6
```
Expand Down
3 changes: 1 addition & 2 deletions bin/pkg-jq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async function main (args: Args): Promise<number> {
const options: JqOptions = {}

if (args.raw) {
// SEE: https://github.com/sanack/node-jq/pull/173
options['raw'] = true
}

Expand Down Expand Up @@ -101,7 +100,7 @@ function parseArguments (): Args {
)

parser.addArgument(
[ '-r' ],
[ '-r', '--raw' ],
{
help: 'output raw strings, not JSON texts.',
action: 'storeConst',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"update-notifier": "^3.0.0"
},
"devDependencies": {
"@chatie/eslint-config": "^0.4.1",
"@chatie/git-scripts": "^0.1.1",
"@chatie/eslint-config": "^0.6.10",
"@chatie/git-scripts": "^0.2.5",
"@chatie/semver": "^0.4.2",
"@chatie/tsconfig": "^0.6.1",
"@types/argparse": "^1.0.36",
"@types/update-notifier": "^2.5.0",
"read-pkg-up": "^6.0.0",
"shx": "^0.3.2",
"tstest": "^0.2.4"
"tstest": "^0.4.2"
},
"scripts": {
"build": "tsc",
Expand Down
2 changes: 1 addition & 1 deletion src/node-jq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function jqFile (
): Promise<string> {
let result = await run(filter, file, options) as string // FIXME

// FIXME: wait for https://github.com/sanack/node-jq/pull/173 to be merged
// FIXME: wait for https://github.com/sanack/node-jq/pull/173 to be published
if (options && options.raw) {
if (result[0] === '"') {
result = result.substr(1, result.length - 2)
Expand Down

0 comments on commit d00926e

Please sign in to comment.