From 54b0361f2a194a02c8da69d8122d4e9344a5a687 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 4 May 2018 09:55:51 +0200 Subject: lib/common-functions: allow "copy" --- lib/common-functions | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/common-functions b/lib/common-functions index 86b8aaa..b524ab6 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -921,8 +921,9 @@ extract_pkgname_epoch_pkgver_pkgrel_sub_pkgrel_arch_from_package_name() { fi } -# irc_say $channel +# irc_say $channel [copy] # say content of stdin in irc channel $channel (default: #archlinux32) +# and print copy to stdout if 'copy' is given # shellcheck disable=SC2120 irc_say() { @@ -933,6 +934,10 @@ irc_say() { channel="$1" fi if [ -p "${irc_dir}/${channel}/in" ]; then - sponge "${irc_dir}/${channel}/in" + if [ "$2" = 'copy' ]; then + pee cat 'sponge '"${irc_dir}/${channel}/in" + else + sponge "${irc_dir}/${channel}/in" + fi fi } -- cgit v1.2.3-70-g09d2