Skip to content

Commit 6e9d07c

Browse files
committed
draft script minor error checking
1 parent 961328a commit 6e9d07c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

new_draft.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
if [ "$#" -ne 3 ]; then
4+
echo "Error: expected 3 parameters"
5+
echo "Usage: $0 <DATE> <ISSUE #> <AUTHOR>"
6+
exit 1
7+
fi
8+
39
ISSUE="_drafts/$1-issue-$2.md"
410

511
touch $ISSUE
@@ -35,3 +41,5 @@ author: $3
3541
> TODO
3642
3743
### Finally" >> $ISSUE
44+
45+
echo "Successfully created '$ISSUE' written by '$3'"

0 commit comments

Comments
 (0)