From 5cba2a96e203e74229128e94dd91051dba30c28f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 25 Apr 2020 13:55:32 +0200 Subject: bin/ii-answer: sanity-check can now be triggered from irc --- bin/ii-answer | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bin/ii-answer') diff --git a/bin/ii-answer b/bin/ii-answer index b16f821..1139064 100755 --- a/bin/ii-answer +++ b/bin/ii-answer @@ -147,6 +147,20 @@ find "${irc_dir}" \ sort -u | \ irc_say "${channel}" 'copy' fi + # answer "sanity-check" + regex='^\S\+ <\S\+> .*[Gg]et.*\(straight\|together\)' + if grep "${regex}" "${out_file}" | \ + grep -q "${sloppy_salutation}"; then + sed -i "/${regex}/d" "${out_file}" + if [ -s "${work_dir}/build-master-sanity" ]; then + printf 'I will check my sanity again.\n' \ + | irc_say "${channel}" 'copy' + sanity-check -w + else + printf 'Are you kidding? I'"'"'m all right.\n' \ + | irc_say "${channel}" 'copy' + fi + fi # answer "say/tell ... new/random/more" regex='^\S\+ <\(\S\+\)> \(.* \)\?\([Ss]ay\|[Tt]ell\).*\(new\|random\|more\).*' if grep "${regex}" "${out_file}" | \ -- cgit v1.2.3-70-g09d2