mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
pull-profile-base-data.sh: omit missing fields
This commit is contained in:
parent
7cb6210847
commit
5beec2e15c
1 changed files with 21 additions and 16 deletions
|
@ -5,21 +5,26 @@ cd $(realpath $(dirname $0))
|
||||||
|
|
||||||
src="transport-apis/data"
|
src="transport-apis/data"
|
||||||
|
|
||||||
query="{\
|
query="(\
|
||||||
auth: {
|
(p, _) => JSON.stringify({\
|
||||||
type: \"AID\",
|
auth: {
|
||||||
aid: .options.auth.aid?, \
|
type: 'AID',
|
||||||
}, \
|
aid: p(_, 'options.auth.aid'), \
|
||||||
salt: .options.checksumSalt, \
|
}, \
|
||||||
client: {
|
salt: p(_, 'options.checksumSalt'), \
|
||||||
type: .options.client.type?, \
|
client: {
|
||||||
id: .options.client.id?, \
|
type: p(_, 'options.client.type'), \
|
||||||
v: .options.client.v?, \
|
id: p(_, 'options.client.id'), \
|
||||||
name: .options.client.name?, \
|
v: p(_, 'options.client.v'), \
|
||||||
}, \
|
name: p(_, 'options.client.name'), \
|
||||||
endpoint: .options.endpoint, \
|
}, \
|
||||||
ext: .options.ext, \
|
endpoint: p(_, 'options.endpoint'), \
|
||||||
ver: .options.version, \
|
ext: p(_, 'options.ext'), \
|
||||||
}"
|
ver: p(_, 'options.ver'), \
|
||||||
|
}, null, '\\t')
|
||||||
|
)(
|
||||||
|
require('lodash/get'),
|
||||||
|
JSON.parse(require('fs').readFileSync(process.argv[1], {encoding: 'utf8'})),
|
||||||
|
)"
|
||||||
|
|
||||||
jq -r --tab "$query" <"$src/de/db-hafas-mgate.json" >../p/db/base.json
|
jq -r --tab "$query" <"$src/de/db-hafas-mgate.json" >../p/db/base.json
|
||||||
|
|
Loading…
Add table
Reference in a new issue