From 5ffbcb3219acaf0d32a5004162170aef3ba3e15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Mari=C8=99?= Date: Sun, 8 Mar 2015 23:42:32 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20Make=20minor=20improvem?= =?UTF-8?q?ents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/clean-whiteboard-photos | 17 ++++++++--------- bin/get-compression-heatmap | 4 ++-- bin/get-content-encoding | 24 +++++++++++++----------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/bin/clean-whiteboard-photos b/bin/clean-whiteboard-photos index 8d0646ea9..7ba421a88 100755 --- a/bin/clean-whiteboard-photos +++ b/bin/clean-whiteboard-photos @@ -33,17 +33,16 @@ clean_whiteboard_photos() { main() { # Check if ImageMagick's convert command-line tool is installed - if [ -x "$(command -v "convert")" ]; then - - while [ $# -ne 0 ]; do - clean_whiteboard_photos "$1" - shift - done - - else + if [ ! -x "$(command -v "convert")" ]; then printf "Please install ImageMagick's 'convert' command-line tool!" + exit; fi + while [ $# -ne 0 ]; do + clean_whiteboard_photos "$1" + shift + done + } -main $@ +main "$@" diff --git a/bin/get-compression-heatmap b/bin/get-compression-heatmap index 071d3af8b..0d2dd21a2 100755 --- a/bin/get-compression-heatmap +++ b/bin/get-compression-heatmap @@ -49,7 +49,7 @@ main() { # Check if `cURL` is installed if [ ! -x "$(command -v "curl")" ]; then - printf "Please install cURL!\n" + printf "cURL is required, please install it!\n" exit; fi @@ -57,7 +57,7 @@ main() { tmpFile="/tmp/$(mktemp -u XXXXX).gz" - # Check if the current command line arguments is a local file + # Check if the current command line argument is a local file if [ -f "$1" ]; then cmd="cat" diff --git a/bin/get-content-encoding b/bin/get-content-encoding index 980302c3e..7d394b4c4 100755 --- a/bin/get-content-encoding +++ b/bin/get-content-encoding @@ -2,8 +2,8 @@ # DESCRIPTION: # -# Provides the content encoding the specified -# resources are served with. +# Provides the content encoding the +# specified resources are served with. # # USAGE: # @@ -167,17 +167,19 @@ get_content_encoding() { main() { - # Check if cURL is installed - if [ -x "$(command -v "curl")" ]; then - while [ $# -ne 0 ]; do - get_content_encoding "$1" - shift - done - printf "\n" - else + # Check if `cURL` is installed + if [ ! -x "$(command -v "curl")" ]; then printf "cURL is required, please install it!\n" + exit; fi + while [ $# -ne 0 ]; do + get_content_encoding "$1" + shift + done + + printf "\n" + } -main $@ +main "$@"