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

ci inside docker should not treat as a wechaty-docker env

上级 3c1df903
/**
* Wechaty - Wechaty for Bot, Connect ChatBots, Chat as a Service
*
*
* https://github.com/wechaty/wechaty/
*/
const { execSync } = require('child_process')
......@@ -47,13 +47,17 @@ Object.assign(Config, {
* 4. Envioronment Identify
*/
Object.assign(Config, {
isDocker: isInsideDocker()
isDocker: isWechatyDocker()
})
function isInsideDocker() {
const cgroup = '/proc/1/cgroup'
function isWechatyDocker() {
const isCi = require('is-ci')
if (isCi) {
return false
}
try { accessSync(cgroup, F_OK) }
const cgroup = '/proc/1/cgroup'
try { accessSync(cgroup, F_OK) }
catch (e) { return false }
const line = execSync(`head -1 ${cgroup}`)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册