Created
June 28, 2025 04:55
-
-
Save ikasoba/a0b6020c7feafd5a55a1e7fd7c2a50d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
if !(command -v emopack > /dev/null); then | |
echo このスクリプトは https://github.com/ikasoba/misskey-emopack に依存しているので、まずはインストールしてくださいにゃ | |
exit 1 | |
fi | |
ToMiName() { | |
basename $(cat) | sed -E ' | |
s/-/_/g; | |
s/牛乳を注ぐおんnya/sosogu/; | |
s/牛乳/gyunyu/; | |
s/ヴィーnyaス誕生/venyas_tanjo/; | |
s/ダリ/dali/; | |
s/フェルメール/vermeer/; | |
s/モーツァルト/mozart/; | |
s/ベートーベン/beethoven/; | |
s/空也上人/saint_kuya/ | |
' | uconv -x latin | |
} | |
cd $(dirname $0) | |
if [ -z "$1" ]; then | |
echo "読み込むディレクトリ(yyyy[mm]-add-nya または all-nya など)指定してくださいにゃ" | |
exit 1 | |
fi | |
prefix=neko_ | |
emojis=$(ls $1 | grep -E '\.(png|gif)$') | |
mkdir -p _pack | |
echo name,file,category,aliases,license > _pack/meta.csv | |
for file in $emojis | |
do | |
destFile=${prefix}$(echo $file | ToMiName) | |
if cp $1/$file _pack/$destFile; then | |
name=${prefix}$(echo $file | ToMiName | sed -E 's/\.(png|gif)$//g') | |
echo ${name},${destFile},ネコチャン,ねこ ネコ 猫, https://note.com/shikamatsu/n/n8818bb5ebea1 >> _pack/meta.csv | |
fi | |
done | |
if [ -f "out.zip" ]; then | |
rm out.zip | |
fi | |
cd _pack | |
emopack pack ../out.zip | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment