From: Fletcher T. Penney Date: Sat, 8 Sep 2018 21:18:40 +0000 (-0400) Subject: UPDATED: Change convenience scripts for better POSIX compliance (implements #150... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95bc39cc5e5f54a7ca4f1098536daf6a8454e11f;p=multimarkdown UPDATED: Change convenience scripts for better POSIX compliance (implements #150) (Thanks, Ryan) --- diff --git a/scripts/markdown b/scripts/markdown index 19a0d39..f48634c 100755 --- a/scripts/markdown +++ b/scripts/markdown @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd b/scripts/mmd index a1a6aa7..52db08c 100755 --- a/scripts/mmd +++ b/scripts/mmd @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2all b/scripts/mmd2all index 0c12310..f0e824b 100755 --- a/scripts/mmd2all +++ b/scripts/mmd2all @@ -21,8 +21,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2epub b/scripts/mmd2epub index 7643541..8482901 100755 --- a/scripts/mmd2epub +++ b/scripts/mmd2epub @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2fodt b/scripts/mmd2fodt index 745755b..4ef4264 100755 --- a/scripts/mmd2fodt +++ b/scripts/mmd2fodt @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2odt b/scripts/mmd2odt index f8985c6..b9c16ba 100755 --- a/scripts/mmd2odt +++ b/scripts/mmd2odt @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2opml b/scripts/mmd2opml index c4b9ed6..95f6ed7 100755 --- a/scripts/mmd2opml +++ b/scripts/mmd2opml @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2pdf b/scripts/mmd2pdf index d8463a6..21695e9 100755 --- a/scripts/mmd2pdf +++ b/scripts/mmd2pdf @@ -27,8 +27,7 @@ done PATH="$DIR:/usr/local/bin:/usr/texbin:/Library/TeX/texbin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1 diff --git a/scripts/mmd2tex b/scripts/mmd2tex index 317ba75..30c1d8b 100755 --- a/scripts/mmd2tex +++ b/scripts/mmd2tex @@ -20,8 +20,7 @@ done PATH="$DIR:/usr/local/bin:$PATH" export PATH -which multimarkdown > /dev/null -if [ $? = 1 ] +if ! command -v multimarkdown >/dev/null 2>&1 then echo multimarkdown executable not found! >&2 exit 1