diff options
author | Leah Neukirchen <leah@vuxu.org> | 2018-11-29 13:18:37 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2018-11-29 13:18:37 +0100 |
commit | 9d28d930e4e01246ca189a075ae4aeb9b6b8ffd4 (patch) | |
tree | 684441432d353d49efb898f14e93ba143578f0a0 /contrib | |
parent | cf15239377c2354b0efe30ad4a4e3974e469e8be (diff) | |
download | mblaze-9d28d930e4e01246ca189a075ae4aeb9b6b8ffd4.tar.gz mblaze-9d28d930e4e01246ca189a075ae4aeb9b6b8ffd4.tar.xz mblaze-9d28d930e4e01246ca189a075ae4aeb9b6b8ffd4.zip |
contrib/menter: more robustness on unexistant messages
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/menter | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/menter b/contrib/menter index f00a92e..21b7693 100755 --- a/contrib/menter +++ b/contrib/menter @@ -1,14 +1,17 @@ #!/bin/sh -e # menter [MSG] - run subshell in temporary directory with MSG extracted -[ "$#" -eq 0 ] && set -- : +[ "$#" -eq 0 ] && set -- . + +f="$(mseq "$1" | sed 1q)" +[ -z "$f" ] && printf 'No message %s.\n' "$1" 1>&2 && exit 1 dir=$(mktemp -d -t menter.XXXXXX) cd "$dir" mshow -t "$1" mshow -x "$1" 2>/dev/null ls -l -ln -s "$(mseq "$1")" msg +ln -s "$f" msg "${SHELL:-/bin/sh}" || true echo rm -r "$dir" rm -r "$dir" |