Add single feed generation script
This commit is contained in:
parent
f0570c11f8
commit
7d54e8e8dc
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
[ -z "$DIR" ] && DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
id="$1"
|
||||
shift
|
||||
|
||||
"$DIR/bin/xml2json" "$DIR/itsb.xml" \
|
||||
| jq '
|
||||
.itsb.section[].source |= [
|
||||
arrays[]
|
||||
| if .["@id"] == $id then . else
|
||||
.feed |= [
|
||||
(if type == "object" then [.] else . end)[]
|
||||
| select(.["@id"] == $id)
|
||||
]
|
||||
| select(.feed | length > 0)
|
||||
end
|
||||
]' --arg id "$id" \
|
||||
| "$DIR/bin/json2xml" \
|
||||
| xsltproc "$DIR/xslt/feedgen.xsl" - \
|
||||
| DIR="$DIR" bash -s -- "$@"
|
Loading…
Reference in New Issue