Skip to content

Commit 39b4aba

Browse files
committed
Add support for Xcode image assets.
To use it, just pass in the path to Images.xcassets/AppIcon.appiconset as the 2nd parameter. The script will check if it ends in .appiconset and behave accordingly.
1 parent 0e5d1bd commit 39b4aba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tagIcons.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ tagMode="tag"
88
cleanupMode="cleanup"
99

1010
iconsDirectory=`cd $2 && pwd`
11-
icons=(`/usr/libexec/PlistBuddy -c "Print CFBundleIconFiles" "${INFOPLIST_FILE}" | grep png | tr -d '\n'`)
11+
if [ $(echo "${iconsDirectory}" | grep -E "\.appiconset$") ]; then
12+
icons=(`grep 'filename' "${iconsDirectory}/Contents.json" | cut -f2 -d: | tr -d ',' | tr -d '\n' | tr -d '"'`)
13+
else
14+
icons=(`/usr/libexec/PlistBuddy -c "Print CFBundleIconFiles" "${INFOPLIST_FILE}" | grep png | tr -d '\n'`)
15+
fi
1216

1317
taggerDirectory=`dirname $0`
1418
taggerPlist="tagImage.workflow/Contents/document.wflow"

0 commit comments

Comments
 (0)