From 4bf2052a1aaa6763d2991f4fbe7a9f362e01b5ae Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:25:25 +0900 Subject: [PATCH 1/7] =?UTF-8?q?keywordEnabled=3Dtrue=E3=81=A7MeCab?= =?UTF-8?q?=E3=81=8C=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AF=E8=B5=B7=E5=8B=95=E5=89=8D=E3=81=AB=E7=95=B0?= =?UTF-8?q?=E5=B8=B8=E7=B5=82=E4=BA=86=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- start.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 start.sh diff --git a/package.json b/package.json index 632b9fb80..7009e08a3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "_v": "1.5.0", "main": "./built/index.js", "scripts": { - "start": "node ./built", + "start": "./start.sh", "build": "tsc", "test": "jest" }, diff --git a/start.sh b/start.sh new file mode 100755 index 000000000..40ab92c9e --- /dev/null +++ b/start.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if (! which mecab) && (grep keywordEnabled config.json | grep -q true); then + echo "You must install MeCab if keywordEnabled is true." + exit 1 +fi + +node ./built From 8f5e353b20cc89401f5252cba83ebeb10f78f7a1 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:30:15 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=82=92=E9=80=86?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 40ab92c9e..0818d1141 100755 --- a/start.sh +++ b/start.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if (! which mecab) && (grep keywordEnabled config.json | grep -q true); then +if (grep keywordEnabled config.json | grep -q true) && (! which mecab); then echo "You must install MeCab if keywordEnabled is true." exit 1 fi From 49d0929c5a453a6f028f6836ae8f9ec8c9838245 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:53:14 +0900 Subject: [PATCH 3/7] =?UTF-8?q?mecab-ipadic-neologd=E3=81=AE=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index 0818d1141..d693e155f 100755 --- a/start.sh +++ b/start.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -if (grep keywordEnabled config.json | grep -q true) && (! which mecab); then - echo "You must install MeCab if keywordEnabled is true." +if (grep keywordEnabled config.json | grep -q true) && (! which mecab) && [ -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then + echo "You must install MeCab and mecab-ipadic-neologd if keywordEnabled is true." exit 1 fi From 38fc0c54ddf086fc08aa8157a658b86a3774ad57 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:54:04 +0900 Subject: [PATCH 4/7] =?UTF-8?q?if=E6=96=87=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index d693e155f..71e9acbc8 100755 --- a/start.sh +++ b/start.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if (grep keywordEnabled config.json | grep -q true) && (! which mecab) && [ -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then +if (grep keywordEnabled config.json | grep -q true) && (! which mecab) && [ ! -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then echo "You must install MeCab and mecab-ipadic-neologd if keywordEnabled is true." exit 1 fi From 180d93e618aa03c147d163094fdc9e5097eddd3b Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:56:16 +0900 Subject: [PATCH 5/7] =?UTF-8?q?Revert=20"if=E6=96=87=E4=BF=AE=E6=AD=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 38fc0c54ddf086fc08aa8157a658b86a3774ad57. --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 71e9acbc8..d693e155f 100755 --- a/start.sh +++ b/start.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if (grep keywordEnabled config.json | grep -q true) && (! which mecab) && [ ! -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then +if (grep keywordEnabled config.json | grep -q true) && (! which mecab) && [ -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then echo "You must install MeCab and mecab-ipadic-neologd if keywordEnabled is true." exit 1 fi From 7c3eaf59d494101338fdf823fa9c1498751dee5b Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:56:19 +0900 Subject: [PATCH 6/7] =?UTF-8?q?Revert=20"mecab-ipadic-neologd=E3=81=AE?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E8=BF=BD=E5=8A=A0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 49d0929c5a453a6f028f6836ae8f9ec8c9838245. --- start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index d693e155f..0818d1141 100755 --- a/start.sh +++ b/start.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -if (grep keywordEnabled config.json | grep -q true) && (! which mecab) && [ -e '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/' ]; then - echo "You must install MeCab and mecab-ipadic-neologd if keywordEnabled is true." +if (grep keywordEnabled config.json | grep -q true) && (! which mecab); then + echo "You must install MeCab if keywordEnabled is true." exit 1 fi From 1a19893f10153a1bec86305d3e2defd9c1276e89 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Sat, 4 Mar 2023 07:59:28 +0900 Subject: [PATCH 7/7] =?UTF-8?q?mecab-ipadic-neologd=E3=81=AE=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index 0818d1141..03eb49418 100755 --- a/start.sh +++ b/start.sh @@ -1,8 +1,15 @@ #!/usr/bin/env bash -if (grep keywordEnabled config.json | grep -q true) && (! which mecab); then - echo "You must install MeCab if keywordEnabled is true." - exit 1 +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 node ./built