From a6774e2bee81197f7e6fe2bf111876e7114350b5 Mon Sep 17 00:00:00 2001 From: "Zhuohuan LI (CARPE DIEM)" Date: Sat, 3 Dec 2016 11:02:29 +0800 Subject: [PATCH] fix `set -e` not work inside wechaty::runBot --- bin/entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index 2eb5ce81..c7400208 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=$? ;; -- GitLab