Browse Source

afficher version et help de pandoc

Sniperovitch 8 years ago
parent
commit
40aed119be
2 changed files with 11 additions and 7 deletions
  1. 2 0
      .travis.yml
  2. 9 7
      cocktail

+ 2 - 0
.travis.yml

@@ -5,5 +5,7 @@ before_install:
 
 script:
   - ./build.sh
+  - "pandoc --version"
+  - "pandoc --help"
   - ./test_cocktail
 

+ 9 - 7
cocktail

@@ -87,13 +87,13 @@ mirror_pad() {
   verbose "[$FUNCNAME] url=$url filename=$filename"
   RESPONSE=$(curl --silent --show-error $url --output $filename 2>&1)
   RC=$?
-  local errstr="[$FUNCNAME] url=$url filename$filename [RC:$RC] $RESPONSE"
-  if test "$RC" -gt 0;
+  local errstr="[$FUNCNAME] RC=[$RC] $RESPONSE"
+  if test "$RC" -eq 0;
   then
+    verbose "$errstr"
+  else
     die "$errstr"
   fi
-
-  verbose "$errstr"
 }
 
 pad2json() {
@@ -106,14 +106,16 @@ pad2json() {
   local input=$1
   local output=$2
   verbose "[$FUNCNAME] input=$input output=$output"
-
   RESPONSE=$(pandoc \
     -f markdown "$input" \
     -o "$output" -t json --self-contained)
   RC=$?
-  if test "$RC" -gt 0;
+  local errstr="[$FUNCNAME] RC=[$RC] $RESPONSE"
+  if test "$RC" -eq 0;
   then
-    die "[$FUNCNAME] RC=[$RC] $RESPONSE"
+    verbose "$errstr"
+  else
+    die "$errstr"
   fi
 }