about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-01-12 16:11:46 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-01-12 16:11:46 +0100
commitd6c2470ad12253fe12287bb8f825887fc38bf320 (patch)
tree44aa850999e78da18a7b9eae5c16afdb73e5a696
parent8427990730e759521261a9e7344812d957405e7f (diff)
downloadmblaze-d6c2470ad12253fe12287bb8f825887fc38bf320.tar.gz
mblaze-d6c2470ad12253fe12287bb8f825887fc38bf320.tar.xz
mblaze-d6c2470ad12253fe12287bb8f825887fc38bf320.zip
mcom: check drafts exist, and ensure they contain a /
-rwxr-xr-xmcom12
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
 			;;