Remove singleIco bin

This commit is contained in:
Jia Hao 2016-03-11 02:11:28 +08:00
parent cedbb443af
commit 3ceafcb2ee
2 changed files with 1 additions and 72 deletions

View File

@ -1,71 +0,0 @@
#!/bin/sh
# USAGE
# ./extractIco <input ico> <outp ico>
# 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

View File

@ -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