Last active
August 13, 2022 19:01
-
-
Save RalXYZ/0010df606e0bf46cd46efb895cae5cb2 to your computer and use it in GitHub Desktop.
Shell script to process Microsoft fluentui-emoji repo, to meet the need of telegram emoji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git clone https://github.com/microsoft/fluentui-emoji.git | |
# change this to your project dir after clone | |
WORK_DIR="/home/ralxyz/Desktop/fluentui-emoji-main" | |
# replace all space in filename to '_' | |
find $WORK_DIR/assets -depth -name "* *" -execdir rename 's/ /_/g' "{}" \; | |
mkdir target | |
# get all png to target dir | |
for file in $WORK_DIR/assets/* | |
do | |
echo ">>> file $file" | |
if [ -d "$file/3D" ] | |
then | |
cp $file/3D/*.png $WORK_DIR/target | |
else | |
for subfile in $file/* | |
do | |
echo ">>> subfile $subfile" | |
if [ -d "$subfile" ] | |
then | |
cp $subfile/3D/*.png $WORK_DIR/target | |
fi | |
done | |
fi | |
done | |
# copress png to 100x100 | |
for file in $WORK_DIR/target/* | |
do | |
convert $file -resize 100x100 $file | |
echo ">>> converted $file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment