提交 83a18eb4 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix npm link bug, add more diagnose messages for docker starter #66

上级 16eb8429
......@@ -46,4 +46,4 @@ VOLUME [ "/bot" ]
ENTRYPOINT [ "/wechaty/bin/entrypoint.sh" ]
CMD [ "start" ]
RUN npm test
#RUN npm test
......@@ -10,11 +10,9 @@ import {
const wechaty = Wechaty.instance()
console.log(`
#### Wechaty Doctor
1. Wechaty version: ${wechaty.version()}
2. ${os.type()} ${os.arch()} version ${os.release()} memory ${Math.floor(os.freemem() / 1024 / 1024)}/${Math.floor(os.totalmem() / 1024 / 1024)} MB
3. Docker: ${Config.isDocker}
`)
......@@ -45,20 +45,20 @@ if [[ "$1" == *.ts || "$1" == *.js ]]; then
}
echo "Linking Wechaty Module ... "
npm link
npm link wechaty > /dev/null
echo "Executing ts-node $botFilePath $@"
ts-node "$botFilePath" $@
ret=$?
ts-node "$botFilePath" $@ || ret=$?
(( $ret != 0 )) && {
read -t 10 -p "Hit ENTER to see the diagnose output ... "
figlet ' BUG REPORT '
read -t 30 -p "Press ENTER to print diagnose output ... " || true
echo "### 1. code of $botFile"
cat $botFilePath
echo '### 2. directory structor of /bot'
ls -l /bot
ls -l /bot/
echo '### 3. package.json'
cat /bot/package.json
......@@ -69,12 +69,14 @@ if [[ "$1" == *.ts || "$1" == *.js ]]; then
echo '### 5. wechaty doctor'
wechaty-doctor
echo '### please include the above diagnose messages if you submit a issue ###'
figlet " Submit a ISSUE "
echo _____________________________________________________________
echo '####### please paste all the above diagnose messages #######'
echo
echo 'Wechaty Issue https://github.com/wechaty/wechaty/issues'
echo
figlet ' BUG REPORT '
read -t 30 -p "Press ENTER to continue ... " || true
}
figlet " Wechaty "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册