1
0

support JSON feeds

This commit is contained in:
dtb 2022-11-05 08:55:45 -04:00
parent b315b02a59
commit be5c22dbb9
4 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,10 @@
#!/bin/sh
while str isvalue "$1"; do
xq '.feed.pig' <"$1"
shift
case "$1" in
*xml)
xq '.feed.pig' <"$1" ;;
*json)
jq '.feed.pig' <"$1" ;;
esac
done

View File

@ -1,5 +1,4 @@
#!/bin/sh
printf "%s\n" "$1" \
| tr -cd '[:alnum:]' \
| xargs printf "%s.xml\n"
| tr -cd '[:alnum:]'

View File

@ -1,6 +1,10 @@
#!/bin/sh
set -e
str isvalue "$PIGPEN" \
str isvalue "$1" \
&& printf "Usage: %s\n" "$0" 1>&2 \
&& exit 64 \
|| str isvalue "$PIGPEN" \
&& printf "%s\n" "$PIGPEN" \
&& exit 0 \
|| str isvalue "$XDG_CONFIG_HOME" \

View File

@ -1,14 +1,7 @@
#!/bin/sh
set -e
filename="$(pig_pen)/$(pig_name $1)"
loop=0
filename="$(pig_pen)/$(pig_name "$1")"
while streq $loop 0; do
loop=1
if test -e "$filename"; then
cat "$filename"
else
pig_stow "$1" && loop=0
fi
done
test -e "$filename" || pig_stow "$1"
cat "$filename"