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.
- package/bin/wd +6 -18
- package/package.json +1 -1
package/bin/wd
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//
|
|
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
|
-
|
|
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')
|