wikibase-cli 15.16.2 → 15.16.3

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.
Files changed (2) hide show
  1. package/bin/wd +6 -18
  2. package/package.json +1 -1
package/bin/wd CHANGED
@@ -1,21 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // This use to be a simple one line shell script, but due to
4
- // compatibility reasons with Windows, it needed to be rewritten
5
- // in the one environment we know is available: node
3
+ process.env.WB_INSTANCE = 'https://www.wikidata.org'
4
+ process.env.WB_SPARQL_ENDPOINT = 'https://query.wikidata.org/sparql'
5
+ // Fake the executed script to be wb to trick commander to believe it
6
+ // as it would otherwise fail to build subcommand paths
7
+ process.argv[1] = process.argv[1].replace(/\/wd$/, '/wb')
6
8
 
7
- const { spawn } = require('child_process')
8
-
9
- const escapeDollars = arg => arg.replace(/\$/g, '\\$')
10
- const args = process.argv.slice(2).map(escapeDollars)
11
-
12
- spawn('wb', args, {
13
- env: Object.assign({
14
- WB_INSTANCE: 'https://www.wikidata.org',
15
- WB_SPARQL_ENDPOINT: 'https://query.wikidata.org/sparql',
16
- }, process.env),
17
- stdio: 'inherit',
18
- // Required to not get a ENOENT on Windows
19
- // See https://stackoverflow.com/a/54515183/3324977
20
- shell: true,
21
- })
9
+ require('./wb')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikibase-cli",
3
- "version": "15.16.2",
3
+ "version": "15.16.3",
4
4
  "description": "A command-line interface to Wikibase",
5
5
  "main": "index.js",
6
6
  "bin": {