about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-07-19 13:07:38 -0500
committerCase Duckworth2022-07-19 13:07:38 -0500
commit7f6dc1bc65f81b9915dbe606da847b0dec15c248 (patch)
tree6489ba7c5b0d7691645f540197426b13545afd81
parentDon't update invidious host if NOFETCH (diff)
downloadsfeed-7f6dc1bc65f81b9915dbe606da847b0dec15c248.tar.gz
sfeed-7f6dc1bc65f81b9915dbe606da847b0dec15c248.zip
Add runcmd
-rwxr-xr-xrunsfeed14
1 files changed, 9 insertions, 5 deletions
diff --git a/runsfeed b/runsfeed index bc49937..75b141b 100755 --- a/runsfeed +++ b/runsfeed
@@ -53,10 +53,16 @@ main() {
53} 53}
54 54
55update_urls() { 55update_urls() {
56 cmd="$(command -v sfeed_update_urls.sh || echo ./sfeed_update_urls.sh)" 56runcmd() {
57 cmd="$(command -v "$1" || echo "./$1")"
58 shift
57 "$cmd" "$@" 59 "$cmd" "$@"
58} 60}
59 61
62update_urls() {
63 runcmd sfeed_update_urls.sh "$@"
64}
65
60get_invidious_url() { 66get_invidious_url() {
61 "${NOFETCH:-false}" && return 67 "${NOFETCH:-false}" && return
62 curl -sL "$1" | 68 curl -sL "$1" |
@@ -70,8 +76,7 @@ log() {
70} 76}
71 77
72update() { 78update() {
73 cmd="$(command -v sfeed_update_xargs || echo ./sfeed_update_xargs)" 79 runcmd sfeed_update_xargs "$@"
74 "$cmd" "$@"
75} 80}
76 81
77opml() { 82opml() {
@@ -79,8 +84,7 @@ opml() {
79} 84}
80 85
81html() { 86html() {
82 converter="$(command -v sfeed_html.sh || echo ./sfeed_html.sh)" 87 runcmd sfeed_html.sh "$@"
83 "$converter" "$@"
84} 88}
85 89
86atom() ( # atom DIRECTORY [DAYS] 90atom() ( # atom DIRECTORY [DAYS]