From 6e5ef9d032ceaa055f42b5c7ee2dee54b5f687ea Mon Sep 17 00:00:00 2001 From: Huan LI Date: Wed, 18 Jul 2018 10:47:31 +0800 Subject: [PATCH] disable link bot node_modules to global (#1478) --- bin/entrypoint.sh | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index fe7190e8..a5ac8284 100755 --- a/bin/entrypoint.sh +++ b/bin/entrypoint.sh @@ -136,20 +136,11 @@ function wechaty::runBot() { echo "Please make sure you had installed all the NPM modules which is depended on your bot script." # yarn < /dev/null || return $? # yarn will close stdin??? cause `read` command fail after yarn - cwd=$(pwd) - for module in node_modules/*; do - [ -e "$module" ] || continue - - module=${module//node_modules\//} - - globalModule="/node_modules/$module" - - if [ ! -e "$globalModule" ]; then - ln -sf "$cwd/node_modules/$module" /node_modules/ - # else - # echo "$globalModule exists" - fi - done + # + # Issue https://github.com/Chatie/wechaty/issues/1478 + # As a conclusion: we should better not to link the local node_modules to the Docker global. + # + # wechaty::linkBotNodeModules } # echo -n "Linking Wechaty module to bot ... " @@ -196,6 +187,24 @@ function wechaty::runBot() { return "$ret" } +# Issue https://github.com/Chatie/wechaty/issues/1478 +# To Be Tested: +function wechaty::linkBotNodeModules() { + for localModule in /bot/node_modules/*; do + [ -e "$localModule" ] || continue + + module=${localModule//\/bot\/node_modules\//} + + globalModule="/node_modules/$module" + + if [ ! -e "$globalModule" ]; then + ln -sf "$localModule" /node_modules/ + # else + # echo "$globalModule exists" + fi + done +} + function wechaty::io-client() { figlet " Chatie.io " figlet " Authing By:" -- GitLab