Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chartEnabled=trueでfont.ttfが配置されていない場合は異常終了する #107

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Misskey用の日本語Botです。
`docker-compose.yml` の `enable_mecab` を `0` にすると、MeCabをインストールしないようにもできます。(メモリが少ない環境など)

## フォント
一部の機能にはフォントが必要です。藍にはフォントは同梱されていないので、ご自身でフォントをインストールディレクトリに`font.ttf`という名前で設置してください。
チャート機能にはフォントが必要です。藍にはフォントは同梱されていないので、ご自身でフォントをインストールディレクトリに`font.ttf`という名前で設置してください。

## 記憶
藍は記憶の保持にインメモリデータベースを使用しており、藍のインストールディレクトリに `memory.json` という名前で永続化されます。
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_v": "1.5.0",
"main": "./built/index.js",
"scripts": {
"start": "node ./built",
"start": "./start.sh",
"build": "tsc",
"test": "jest"
},
Expand Down
20 changes: 20 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

if grep keywordEnabled config.json | grep -q true; then
if ! which mecab; then
echo "You must install MeCab if keywordEnabled is true."
exit 1
fi

if [ ! -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then
echo "You must install mecab-ipadic-neologd if keywordEnabled is true."
exit 1
fi
fi

if (grep chartEnabled config.json | grep -q true) && [ ! -f ./font.ttf ]; then
echo "You must put font.ttf if chartEnabled is true"
exit 1
fi

node ./built