diff options
author | Leah Neukirchen <leah@vuxu.org> | 2019-01-12 16:11:46 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2019-01-12 16:11:46 +0100 |
commit | d6c2470ad12253fe12287bb8f825887fc38bf320 (patch) | |
tree | 44aa850999e78da18a7b9eae5c16afdb73e5a696 | |
parent | 8427990730e759521261a9e7344812d957405e7f (diff) | |
download | mblaze-d6c2470ad12253fe12287bb8f825887fc38bf320.tar.gz mblaze-d6c2470ad12253fe12287bb8f825887fc38bf320.tar.xz mblaze-d6c2470ad12253fe12287bb8f825887fc38bf320.zip |
mcom: check drafts exist, and ensure they contain a /
-rwxr-xr-x | mcom | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mcom b/mcom index 0d7f304..019c819 100755 --- a/mcom +++ b/mcom @@ -91,8 +91,16 @@ case "$0" in shift resume=1 if [ "$#" -gt 0 ]; then - echo "used draft $1" - draft="$1" + case "$1" in + /*|./*) draft="$1";; + *) draft="./$1";; + esac + if ! [ -f "$draft" ]; then + printf 'mcom: no such draft %s\n' \ + "$draft" 1>&2 + exit 1 + fi + echo "using draft $draft" shift fi ;; |