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"
|
||||
|
||||
query="{\
|
||||
auth: {
|
||||
type: \"AID\",
|
||||
aid: .options.auth.aid?, \
|
||||
}, \
|
||||
salt: .options.checksumSalt, \
|
||||
client: {
|
||||
type: .options.client.type?, \
|
||||
id: .options.client.id?, \
|
||||
v: .options.client.v?, \
|
||||
name: .options.client.name?, \
|
||||
}, \
|
||||
endpoint: .options.endpoint, \
|
||||
ext: .options.ext, \
|
||||
ver: .options.version, \
|
||||
}"
|
||||
query="(\
|
||||
(p, _) => JSON.stringify({\
|
||||
auth: {
|
||||
type: 'AID',
|
||||
aid: p(_, 'options.auth.aid'), \
|
||||
}, \
|
||||
salt: p(_, 'options.checksumSalt'), \
|
||||
client: {
|
||||
type: p(_, 'options.client.type'), \
|
||||
id: p(_, 'options.client.id'), \
|
||||
v: p(_, 'options.client.v'), \
|
||||
name: p(_, 'options.client.name'), \
|
||||
}, \
|
||||
endpoint: p(_, 'options.endpoint'), \
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue