wikibase-cli 16.0.1 → 16.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/wb-add-claim +1 -0
- package/lib/edit/edit_command.js +5 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version info
|
|
|
54
54
|
## Dependencies
|
|
55
55
|
|
|
56
56
|
### General
|
|
57
|
-
* [NodeJs](https://nodejs.org) **>=
|
|
57
|
+
* [NodeJs](https://nodejs.org) **>= v10** (recommended way to install it: use the awesome [NVM](https://github.com/creationix/nvm) to install the latest LTS version `nvm install --lts`)
|
|
58
58
|
* [Git](https://git-scm.com/)
|
|
59
59
|
|
|
60
60
|
### Per feature
|
package/bin/wb-add-claim
CHANGED
|
@@ -7,4 +7,5 @@ const inlineArgsParser = ([ id, property, value ]) => {
|
|
|
7
7
|
return [ data ]
|
|
8
8
|
}
|
|
9
9
|
program.customArgsParser = polymorphicCommandArgsParser(inlineArgsParser)
|
|
10
|
+
program.customHelpOption = require('../lib/command_with_template_custom_help')
|
|
10
11
|
require('../lib/edit/edit_command')('claim', 'add')
|
package/lib/edit/edit_command.js
CHANGED
|
@@ -152,7 +152,7 @@ const runInBatch = (section, action, exitOnError) => {
|
|
|
152
152
|
successes++
|
|
153
153
|
} catch (err) {
|
|
154
154
|
errors++
|
|
155
|
-
if (exitOnError)
|
|
155
|
+
if (exitOnError) logErrorAndExit(err)
|
|
156
156
|
else if (err.code === 'EMPTY_PARAMS') console.error('produced an empty parameters object: passing')
|
|
157
157
|
else console.error(`error triggered by line: "${line}":`, err)
|
|
158
158
|
}
|
|
@@ -175,6 +175,10 @@ const randomKey = () => Math.random().toString(16).slice(2)
|
|
|
175
175
|
const logErrorAndExit = err => {
|
|
176
176
|
if (err.statusCode === 400) {
|
|
177
177
|
console.error(red(err.message), err.context)
|
|
178
|
+
} else if (err.body && err.body.error && err.body.error.messages) {
|
|
179
|
+
err.body.error.messages.forEach(message => {
|
|
180
|
+
console.error(`${red(message.name)}\n${JSON.stringify(message, null, 2)}`)
|
|
181
|
+
})
|
|
178
182
|
} else {
|
|
179
183
|
// util.inspect doc: https://nodejs.org/api/util.html#util_util_inspect_object_options
|
|
180
184
|
console.error(inspect(err, { depth: null, maxArrayLength: null }))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikibase-cli",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.2",
|
|
4
4
|
"description": "A command-line interface to Wikibase",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"shell-quote": "^1.7.3",
|
|
51
51
|
"split": "^1.0.1",
|
|
52
52
|
"through": "^2.3.8",
|
|
53
|
-
"wikibase-edit": "^5.0.
|
|
53
|
+
"wikibase-edit": "^5.0.3",
|
|
54
54
|
"wikibase-sdk": "^8.0.0",
|
|
55
55
|
"wikidata-lang": "^2.0.11"
|
|
56
56
|
},
|