about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-01-19 22:16:23 +0100
committertoonn <toonn@toonn.io>2019-01-19 22:16:23 +0100
commitf29040739d6ffaa425da3f6ae0a16083aa66d67f (patch)
treeaf19fa69e9ab1ee2b6bef06572197c9a4982945b
parentf30e06156165e062d56cf9bcdcd1c0ad23d7ad52 (diff)
downloadranger-f29040739d6ffaa425da3f6ae0a16083aa66d67f.tar.gz
Fix couple shellcheck suggestions
One un-double-quoted variable substitution. Directly use the commands
escape code rather than relying on "$?", this also drops the need to
rely on `>` which is for string comparison specifically.
-rwxr-xr-xranger/data/scope.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 49d5a7ea..849d9714 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -131,17 +131,17 @@ handle_image() {
 
         # Font
         application/font*|application/*opentype)
-            preview_png="/tmp/$(basename ${IMAGE_CACHE_PATH%.*}).png"
-            fontimage -o "${preview_png}" \
-                      --pixelsize "120" \
-                      --fontname \
-                      --pixelsize "80" \
-                      --text "  ABCDEFGHIJKLMNOPQRSTUVWXYZ  " \
-                      --text "  abcdefghijklmnopqrstuvwxyz  " \
-                      --text "  0123456789.:,;(*!?') ff fl fi ffi ffl  " \
-                      --text "  The quick brown fox jumps over the lazy dog.  " \
-                      "${FILE_PATH}"
-            if [[ "$?" > 0 ]] ; then
+            preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
+            if fontimage -o "${preview_png}" \
+                         --pixelsize "120" \
+                         --fontname \
+                         --pixelsize "80" \
+                         --text "  ABCDEFGHIJKLMNOPQRSTUVWXYZ  " \
+                         --text "  abcdefghijklmnopqrstuvwxyz  " \
+                         --text "  0123456789.:,;(*!?') ff fl fi ffi ffl  " \
+                         --text "  The quick brown fox jumps over the lazy dog.  " \
+                         "${FILE_PATH}";
+            then
                 exit 1
             else
                 convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \