diff options
author | Erich Eckner <git@eckner.net> | 2018-05-04 09:55:51 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-05-04 09:55:51 +0200 |
commit | 54b0361f2a194a02c8da69d8122d4e9344a5a687 (patch) | |
tree | eff63ce4beba1b64057ccd5aad62e160023fcaba | |
parent | 567e716c8696754f4b3323f962a616e9be12115d (diff) | |
download | builder-54b0361f2a194a02c8da69d8122d4e9344a5a687.tar.xz |
lib/common-functions: allow "copy"
-rwxr-xr-x | lib/common-functions | 9 |
1 files 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 } |