remy / wm

webmention check service
https://webmention.app
103 stars 17 forks source link

Exit with status code 1 if no endpoints found #64

Open RobinBoers opened 6 months ago

RobinBoers commented 6 months ago

This allows people to write the following kind of code:

if  wm "$1" && prompt -y "Send mentions for these URLs?"; then
    wm "$1" --send
fi

Instead of this monstrosity:

out="$(wm "$1")"
echo "$out"

if [ "$out" != "No webmention endpoints found on 1 entries found (try increasing with --limit N)" ] && prompt -y "Send mentions for these URLs?"; then
  wm "$1" --send
fi
remy commented 6 months ago

Good change. Though, should it also exit(1) with the --send flag too?

RobinBoers commented 6 months ago

As I see it, trying to send webmentions but failing to do so is a failure, so it should exit(1). But I'm open for other ideas too, what do you think?