Sha256: 3a150fdfddad16a2d1d5b3ca713b4b95321a6eab942c98ee3573578ba429e090
Contents?: true
Size: 1.69 KB
Versions: 8
Compression:
Stored size: 1.69 KB
Contents
#!/bin/bash # ------------------------------------ # LOCATE THIS SCRIPT # ------------------------------------ CLI_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ------------------------------------ # IMPORT BASH LIBRARY # ------------------------------------ source "${CLI_PATH}/imageOptimBashLib" # ------------------------------------ # INGEST COMMAND LINE ARGUMENTS # ------------------------------------ while [ "$1" != "" ]; do case $1 in -d | --directory ) shift; DIRECTORY_OPTION="$1" ;; -a | --image-alpha ) USE_IMAGE_ALPHA="true" ;; -j | --jpeg-mini ) USE_JPEGMINI="true" ;; -m | --min-quality ) shift; MIN_QUALITY="$1" ;; -s | --skip-if-larger ) SKIP_IF_LARGER="true" ;; -q | --quit ) QUIT_ON_COMPLETE="true" ;; -c | --no-color ) NO_COLOR="true" ;; -h | --help ) usage; exit 0 ;; -e | --examples ) examples; exit 0 ;; --verbose ) IS_VERBOSE="true" ;; -v | --version ) echo $VERSION; exit 0 ;; * ) usage exit 1 esac shift done # ------------------------------------ # POPULATE VARIABLES # ------------------------------------ # Determine which Applications are installed. HAS_IMAGE_OPTIM=$(has_imageoptim) HAS_JPEGMINI=$(has_jpegmini) HAS_IMAGEMAGICK=$(has_imagemagick) HAS_GUI_SCRIPT=`osascript -e 'tell application "System Events" to get UI elements enabled'` JPEGMINI_NAME=$(get_jpegmini_app_name) # ------------------------------------ # BEGIN PROCESSING # ------------------------------------ start run_image_alpha run_jpegmini run_image_optim output_savings finish
Version data entries
8 entries across 8 versions & 1 rubygems