diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2021-01-25 19:30:21 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2021-01-27 15:24:02 +0100 |
commit | 1b3f13b1ba5a3e40d4c9266f16091ad347aec333 (patch) | |
tree | 7cdb168976940997284f1f5962a8469de7a0b31a /sfeed_update | |
parent | f1883579dfcb256b514defcece7bf88fe65ee659 (diff) |
sfeed_update: shuffle code getting the path of the feedurl to make the basesiteurl
Move it closer before it is used.
Diffstat (limited to 'sfeed_update')
-rwxr-xr-x | sfeed_update | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sfeed_update b/sfeed_update index d975518..96f1111 100755 --- a/sfeed_update +++ b/sfeed_update @@ -94,12 +94,6 @@ feed() { basesiteurl="$3" encoding="$4" - # if baseurl is empty then use the path from the feed by default. - if [ "${basesiteurl}" = "" ]; then - host="${feedurl##*://}" - basesiteurl="${feedurl%%://*}://${host%/*}/" - fi - filename="$(printf '%s' "${name}" | tr '/' '_')" sfeedfile="${sfeedpath}/${filename}" tmpfeedfile="${sfeedtmpdir}/${filename}" @@ -121,6 +115,12 @@ feed() { fi rm -f "${tmpfeedfile}.fetch" + # if baseurl is empty then use the path from the feed by default. + if [ "${basesiteurl}" = "" ]; then + host="${feedurl##*://}" + basesiteurl="${feedurl%%://*}://${host%/*}/" + fi + if ! parse "${name}" "${feedurl}" "${basesiteurl}" < "${tmpfeedfile}.utf8" > "${tmpfeedfile}.tsv"; then log "${name}" "FAIL (PARSE)" return |