From 3ceafcb2ee11ef21f5faa2683f039e21609d002a Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Fri, 11 Mar 2016 02:11:28 +0800 Subject: [PATCH] Remove singleIco bin --- bin/singleIco | 71 ------------------------------------------ src/build/iconBuild.js | 2 +- 2 files changed, 1 insertion(+), 72 deletions(-) delete mode 100755 bin/singleIco diff --git a/bin/singleIco b/bin/singleIco deleted file mode 100755 index 3947478..0000000 --- a/bin/singleIco +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -# USAGE - -# ./extractIco -# Make sure the output extension is '.ico'! - -# Example -# ./extractIco.sh ~/SOME_MULTIPLE_ICO.png ~/Desktop/SINGLE.ico - -# Exec Paths -IMAGEMAGICK_CONVERT=$(which convert) -IMAGEMAGICK_IDENTIFY=$(which identify) - -if [ ! -x "${IMAGEMAGICK_CONVERT}" ]; then - echo "Cannot find required ImageMagick Convert executable" >&2 - exit 1; -fi -if [ ! -x "${IMAGEMAGICK_IDENTIFY}" ]; then - echo "Cannot find required ImageMagick Identify executable" >&2 - exit 1; -fi - -# Parameters -SOURCE=$1 -DEST=$2 - -# Check source and destination arguments -if [ -z "${SOURCE}" ]; then - echo "No source image specified" >&2 - exit 1 -fi - -if [ -z "${DEST}" ]; then - echo "No destination specified" >&2 - exit 1 -fi - -# check if source exists -if [ ! -f "${SOURCE}" ]; then - echo "Source file not found" >&2 - exit 1 -fi - -# File Infrastructure -NAME=$(basename "${SOURCE}") -EXT="${NAME##*.}" -BASE="${NAME%.*}" -TEMP_DIR="${BASE}.iconset" - -if [ "${EXT}" != "ico" ]; then - echo "Source file is not a .ico" >&2 - exit 1 -fi - -# check if .ico is a sequence -IS_ICO_SET="$(identify ${SOURCE} | grep -e "\w\.ico\[0")" - -if [ "${IS_ICO_SET}" ]; then - mkdir "${TEMP_DIR}" - - # extract the largest(?) image from the set - convert "${SOURCE}" "${TEMP_DIR}/${BASE}.png" - convert "${TEMP_DIR}/${BASE}-0.png" "${DEST}" - - # Clean up the temp dir - rm -rf "${TEMP_DIR}" -else - cp "${SOURCE}" "${DEST}" -fi - diff --git a/src/build/iconBuild.js b/src/build/iconBuild.js index bbcdb97..bda0aa3 100644 --- a/src/build/iconBuild.js +++ b/src/build/iconBuild.js @@ -3,7 +3,7 @@ import helpers from './../helpers/helpers'; import iconShellHelpers from './../helpers/iconShellHelpers'; const {isOSX} = helpers; -const {singleIco, convertToPng, convertToIcns} = iconShellHelpers; +const {convertToPng, convertToIcns} = iconShellHelpers; /** * @callback augmentIconsCallback