Browse files

So it actually works.

  • Loading branch information...
1 parent e2ad0f6 commit 734b57bd4e4e23edc69d81aeca42482299ae62c4 @nuclearsandwich nuclearsandwich committed Sep 21, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 bin/dmca
View
9 bin/dmca
@@ -15,18 +15,21 @@ ADVANCED:
dmca_title="$@"
-[[ -n "$dmca_title" ]] || usage && exit 127
+if [ ! -n "$dmca_title" ]; then
+ usage
+ exit 1
+fi
date_prefix="$(date +%Y-%m-%d)"
file_title=$(echo "$dmca_title" \
| tr -d '\n' \
| tr '[:upper:]' '[:lower:]' \
| tr -c '[:alnum:]' '-')
-filename="${date_prefix}_${file_title}.markdown"
+filename="${date_prefix}-${file_title}.markdown"
if [ -n "$VISUAL" ]; then
- $VISUAL $filename
+ exec $VISUAL $filename
else
touch $filename
fi

0 comments on commit 734b57b

Please sign in to comment.