Skip to content

Instantly share code, notes, and snippets.

@RalXYZ
Last active August 13, 2022 19:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RalXYZ/0010df606e0bf46cd46efb895cae5cb2 to your computer and use it in GitHub Desktop.
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
# 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