Fix shell script pointed out in Codacy
@@ -30,10 +30,10 @@ if [ ! -d /usr/include/freetype ]; then
sudo ln -sf /usr/include/freetype2 /usr/include/freetype
fi
-project_dir=`pwd`
-build_dir=${project_dir}/build-ImageMagick/ImageMagick-${IMAGEMAGICK_VERSION}
+project_dir=$(pwd)
+build_dir="${project_dir}/build-ImageMagick/ImageMagick-${IMAGEMAGICK_VERSION}"
if [ -v CONFIGURE_OPTIONS ]; then
- build_dir=${build_dir}-${CONFIGURE_OPTIONS}
+ build_dir="${build_dir}-${CONFIGURE_OPTIONS}"
fi
build_imagemagick() {
@@ -41,38 +41,38 @@ build_imagemagick() {
version=(${IMAGEMAGICK_VERSION//./ })
if (( "${version[0]}" >= 7 )); then
- wget https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz
- tar -xf ${IMAGEMAGICK_VERSION}.tar.gz
- mv ImageMagick-${IMAGEMAGICK_VERSION} $build_dir
+ wget "https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz"
+ tar -xf "${IMAGEMAGICK_VERSION}.tar.gz"
+ mv "ImageMagick-${IMAGEMAGICK_VERSION}" "${build_dir}"
elif (( "${version[0]}${version[1]}" >= 69 )); then
- wget https://github.com/ImageMagick/ImageMagick6/archive/${IMAGEMAGICK_VERSION}.tar.gz
- tar -xf ${IMAGEMAGICK_VERSION}.tar.gz
- rm ${IMAGEMAGICK_VERSION}.tar.gz
- mv ImageMagick6-${IMAGEMAGICK_VERSION} $build_dir
+ wget "https://github.com/ImageMagick/ImageMagick6/archive/${IMAGEMAGICK_VERSION}.tar.gz"
+ tar -xf "${IMAGEMAGICK_VERSION}.tar.gz"
+ rm "${IMAGEMAGICK_VERSION}.tar.gz"
+ mv "ImageMagick6-${IMAGEMAGICK_VERSION}" "${build_dir}"
else
- wget https://imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz
- tar -xf ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz
- rm ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz
- mv ImageMagick-${IMAGEMAGICK_VERSION} $build_dir
+ wget "https://imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
+ tar -xf "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
+ rm "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
+ mv "ImageMagick-${IMAGEMAGICK_VERSION}" "${build_dir}"
fi
options="--with-magick-plus-plus=no --disable-docs"
if [ -v CONFIGURE_OPTIONS ]; then
- options="${CONFIGURE_OPTIONS} $options"
+ options="${CONFIGURE_OPTIONS} ${options}"
fi
- cd $build_dir
- CC="ccache cc" CXX="ccache c++" ./configure --prefix=/usr $options
+ cd "${build_dir}"
+ CC="ccache cc" CXX="ccache c++" ./configure --prefix=/usr "${options}"
make -j
}
-if [ ! -d $build_dir ]; then
+if [ ! -d "${build_dir}" ]; then
build_imagemagick
fi
-cd $build_dir
+cd "${build_dir}"
sudo make install -j
-cd $project_dir
+cd "${project_dir}"
sudo ldconfig
