diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index 2eb5ce81746e68a31ddcf2b4fcfcbe86ab9804cd..c7400208ef4717ee5ca954203fc6d9d2b8e97b01 100755 --- a/bin/entrypoint.sh +++ b/bin/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Wechaty - Connect ChatBots # @@ -111,7 +111,7 @@ function wechaty::runBot() { [ -f package.json ] && { echo "Install dependencies modules ..." - yarn < /dev/null # yarn will close stdin??? cause `read` command fail after yarn + yarn < /dev/null || return $? # yarn will close stdin??? cause `read` command fail after yarn } # echo -n "Linking Wechaty module to bot ... " @@ -224,6 +224,8 @@ function main() { # 2. Run a bot # *.ts | *.js) + # set -e will not work inside wechaty::runBot because of + # http://stackoverflow.com/a/4073372/1123955 wechaty::runBot "$@" || ret=$? ;;