test markdown before editing *.md files

This commit is contained in:
Alexey Shpakovsky 2014-05-21 20:27:41 +02:00
parent ac7437778e
commit 39c4a80cec

5
bb.sh
View File

@ -361,6 +361,11 @@ edit() {
filename="$1" filename="$1"
else else
if [[ "${1##*.}" == "md" ]]; then if [[ "${1##*.}" == "md" ]]; then
test_markdown
if [[ "$?" -ne 0 ]]; then
echo "Markdown is not working, please edit HTML file directly."
exit
fi
# editing markdown file # editing markdown file
$EDITOR "$1" $EDITOR "$1"
TMPFILE="$(markdown "$1")" TMPFILE="$(markdown "$1")"