From 40b4ea1a34d19cb5210246d8a1d2ea19a0893b65 Mon Sep 17 00:00:00 2001 From: Michaelangel007 Date: Thu, 25 Aug 2016 08:19:29 -0700 Subject: [PATCH] Remove DOS/Windows path shenanigans from Unix script utilities --- shr/scripts/aspect43.sh | 20 ++++++++++++++++---- shr/scripts/cvt.sh | 8 +++++++- shr/scripts/cvt2bmp.sh | 8 +++++++- shr/scripts/magall.sh | 9 ++++++++- shr/scripts/pad43.sh | 19 ++++++++++++++++--- shr/scripts/slicer.sh | 10 +++++++++- 6 files changed, 63 insertions(+), 11 deletions(-) diff --git a/shr/scripts/aspect43.sh b/shr/scripts/aspect43.sh index 5ca04b8..1d782ff 100755 --- a/shr/scripts/aspect43.sh +++ b/shr/scripts/aspect43.sh @@ -7,8 +7,8 @@ # MAGICK="c:/IM/convert" # IDENTIFY="c:/IM/identify" # for ImageMagick version 7 use the following -MAGICK="c:/IM/magick" -IDENTIFY="c:/IM/magick identify" +#MAGICK="c:/IM/magick" +#IDENTIFY="c:/IM/magick identify" # For most modern Linux distributions, all ImageMagick binaries are located in: /usr/bin/ (see below) # for ImageMagick version 6.9 use the following @@ -17,11 +17,23 @@ IDENTIFY="c:/IM/magick identify" # for ImageMagick version 7 use the following # MAGICK="/usr/bin/magick" # IDENTIFY="/usr/bin/magick identify" +MAGICK=`which magick` +IDENTIFY=`which magick` identify + +if [ ! -z "${MAGICK}" ]; then + echo "ERROR: Image Magick isn't installed." + exit 1 +fi # set path to A2B converter below -A2B="C:/SHR/A2B2016/a2b" +#A2B="C:/SHR/A2B2016/a2b" # For most modern Linux distributions, consider locating A2B in: /usr/bin/ (see below) -# A2B="/usr/bin/a2b" +A2B="/usr/local/bin/a2b" + +if [ ! -z "${A2B}" ]; then + echo "ERROR: Couldn't find path to 'a2b'" + exit 1 +fi # default usage method="a43s" diff --git a/shr/scripts/cvt.sh b/shr/scripts/cvt.sh index 07b61ad..4788c06 100755 --- a/shr/scripts/cvt.sh +++ b/shr/scripts/cvt.sh @@ -2,9 +2,15 @@ # cvt.sh - creates 6 variations of 320 x 200 SHR files using A2B and external segmented palettes # set path to A2B converter below -A2B="F:/SHR/A2B2015/a2b" +#A2B="F:/SHR/A2B2015/a2b" # For most modern Linux distributions, consider locating A2B in: /usr/bin/ (see below) # A2B="/usr/bin/a2b" +A2B="/usr/local/bin/a2b" + +if [ ! -z "${A2B}" ]; then + echo "ERROR: Couldn't find path to 'a2b'" + exit 1 +fi if [ ! -e SH30709 ]; then mkdir SH30709 diff --git a/shr/scripts/cvt2bmp.sh b/shr/scripts/cvt2bmp.sh index 609e35f..b4e86ca 100755 --- a/shr/scripts/cvt2bmp.sh +++ b/shr/scripts/cvt2bmp.sh @@ -5,13 +5,19 @@ # for ImageMagick version 6.9 use the following # MAGICK="c:/IM/convert" # for ImageMagick version 7 use the following -MAGICK="c:/IM/magick" +#MAGICK="c:/IM/magick" # For most modern Linux distributions, all ImageMagick binaries are located in: /usr/bin/ (see below) # for ImageMagick version 6.9 use the following # MAGICK="/usr/bin/convert" # for ImageMagick version 7 use the following # MAGICK="/usr/bin/magick" +MAGICK=`which magick` + +if [ ! -z "${MAGICK}" ]; then + echo "ERROR: Image Magick isn't installed." + exit 1 +fi if [ ! -e BMP320 ]; then mkdir BMP320 diff --git a/shr/scripts/magall.sh b/shr/scripts/magall.sh index 1049f84..d939c9b 100755 --- a/shr/scripts/magall.sh +++ b/shr/scripts/magall.sh @@ -9,12 +9,19 @@ # for ImageMagick version 6.9 use ImageMagick's convert utility # MAGICK="C:/IM/convert" # for ImageMagick version 7 use the following -MAGICK="C:/IM/magick" +#MAGICK="C:/IM/magick" + # For most modern Linux distributions, all ImageMagick binaries are located in: /usr/bin/ (see below) # for ImageMagick version 6.9 # MAGICK="/usr/bin/convert" # for ImageMagick version 7 # MAGICK="/usr/bin/magick" +MAGICK=`which magick` + +if [ ! -z "${MAGICK}" ]; then + echo "ERROR: Image Magick isn't installed." + exit 1 +fi cd SH30709raw if [ ! -e png ]; then diff --git a/shr/scripts/pad43.sh b/shr/scripts/pad43.sh index 692d29d..76fbb7d 100755 --- a/shr/scripts/pad43.sh +++ b/shr/scripts/pad43.sh @@ -7,8 +7,8 @@ # MAGICK="c:/IM/convert" # IDENTIFY="c:/IM/identify" # for ImageMagick version 7 use the following -MAGICK="c:/IM/magick" -IDENTIFY="c:/IM/magick identify" +#MAGICK="c:/IM/magick" +#IDENTIFY="c:/IM/magick identify" # For most modern Linux distributions, all ImageMagick binaries are located in: /usr/bin/ (see below) # for ImageMagick version 6.9 use the following @@ -17,11 +17,24 @@ IDENTIFY="c:/IM/magick identify" # for ImageMagick version 7 use the following # MAGICK="/usr/bin/magick" # IDENTIFY="/usr/bin/magick identify" +MAGICK=`which magick` +IDENTIFY=`which magick` identify + +if [ ! -z "${MAGICK}" ]; then + echo "ERROR: Image Magick isn't installed." + exit 1 +fi # set path to A2B converter below -A2B="C:/SHR/A2B2016/a2b" +#A2B="C:/SHR/A2B2016/a2b" # For most modern Linux distributions, consider locating A2B in: /usr/bin/ (see below) # A2B="/usr/bin/a2b" +A2B="/usr/local/bin/a2b" + +if [ ! -z "${A2B}" ]; then + echo "ERROR: Couldn't find path to 'a2b'" + exit 1 +fi # default usage method="p43s" diff --git a/shr/scripts/slicer.sh b/shr/scripts/slicer.sh index 8a4bf88..33a67ee 100755 --- a/shr/scripts/slicer.sh +++ b/shr/scripts/slicer.sh @@ -5,12 +5,20 @@ # for ImageMagick version 6.9 use ImageMagick's convert utility # MAGICK="C:/IM/convert" # for ImageMagick version 7 use the following -MAGICK="C:/IM/magick" +#MAGICK="C:/IM/magick" + # For most modern Linux distributions, all ImageMagick binaries are located in: /usr/bin/ (see below) # for ImageMagick version 6.9 # MAGICK="/usr/bin/convert" # for ImageMagick version 7 # MAGICK="/usr/bin/magick" +MAGICK=`which magick` +IDENTIFY=`which magick` identify + +if [ ! -z "${MAGICK}" ]; then + echo "ERROR: Image Magick isn't installed." + exit 1 +fi # create directory structure for 16 color image segments if [ ! -e sh0pcx ]; then