Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
07878c04
W
wechaty
项目概览
.www.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
07878c04
编写于
10月 26, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug ci
上级
f6c0df9d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
16 deletion
+19
-16
Dockerfile
Dockerfile
+6
-5
package.json
package.json
+1
-1
src/puppet-web/browser.ts
src/puppet-web/browser.ts
+1
-1
src/wechaty.ts
src/wechaty.ts
+11
-9
未找到文件。
Dockerfile
浏览文件 @
07878c04
...
...
@@ -4,11 +4,12 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
&&
sh
-c
'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN
apt-get update
-q
&&
apt-get
install
-qy
\
apt-utils
\
chromium
\
google-chrome-stable
\
vim
\
xvfb
apt-utils
\
chromium
\
google-chrome-stable
\
vim
\
xvfb
\
&&
rm
-rf
/tmp/
*
WORKDIR
/wechaty
...
...
package.json
浏览文件 @
07878c04
...
...
@@ -28,7 +28,7 @@
"posttest"
:
"npm run clean && npm run sloc"
,
"test:phantomjs"
:
"cross-env LC_ALL=C WECHATY_LOG=info WECHATY_HEAD=phantomjs ava --timeout=10m
\"
dist/test/*.spec.js
\"
"
,
"test:phantomjs.bak"
:
"cross-env LC_ALL=C WECHATY_LOG=info WECHATY_HEAD=phantomjs ava --timeout=10m
\"
dist/{src,test}/**/*.spec.js
\"
"
,
"test:chrome"
:
"cross-env LC_ALL=C WECHATY_LOG=info WECHATY_HEAD=chrome ava --concurrency
5
--ext js --timeout=10m
\"
dist/{src,test}/**/*.spec.js
\"
"
,
"test:chrome"
:
"cross-env LC_ALL=C WECHATY_LOG=info WECHATY_HEAD=chrome ava --concurrency
2
--ext js --timeout=10m
\"
dist/{src,test}/**/*.spec.js
\"
"
,
"testdev"
:
"cross-env LC_ALL=C WECHATY_LOG=silly ava --ext ts --serial --verbose --fail-fast --timeout=3m"
,
"testdist"
:
"WECHATY_HEAD=phantomjs ava --ext ts --verbose --fail-fast --timeout=3m"
,
"ava"
:
"cross-env LC_ALL=C WECHATY_LOG=verbose ts-node node_modules/.bin/ava
\"
{src,test}/**/*.spec.js
\"
"
,
...
...
src/puppet-web/browser.ts
浏览文件 @
07878c04
...
...
@@ -373,7 +373,7 @@ export class Browser extends EventEmitter {
this
.
emit
(
'
dead
'
,
msg
)
}
else
{
log
.
warn
(
'
PuppetWebBrowser
'
,
'
dead() wil not emit `dead` event because %s
'
,
'
state is not
both `open` or state is inprocess()
'
,
'
state is not
`stable open`
'
)
}
}
...
...
src/wechaty.ts
浏览文件 @
07878c04
...
...
@@ -54,7 +54,6 @@ export class Wechaty extends EventEmitter implements Sayable {
public
puppet
:
Puppet
|
null
// private inited: boolean = false
private
state
=
new
StateMonitor
<
'
standby
'
,
'
ready
'
>
(
'
Wechaty
'
,
'
standby
'
)
private
npmVersion
:
string
...
...
@@ -62,7 +61,7 @@ export class Wechaty extends EventEmitter implements Sayable {
public
static
instance
(
setting
?:
WechatySetting
)
{
if
(
setting
&&
this
.
_instance
)
{
throw
new
Error
(
'
there has already a instance. no params allowed any more
'
)
throw
new
Error
(
'
there has already a instance. no params
will be
allowed any more
'
)
}
if
(
!
this
.
_instance
)
{
this
.
_instance
=
new
Wechaty
(
setting
)
...
...
@@ -89,10 +88,6 @@ export class Wechaty extends EventEmitter implements Sayable {
this
.
npmVersion
=
require
(
'
../package.json
'
).
version
this
.
uuid
=
UtilLib
.
guid
()
// this.inited = false
// Wechaty._instance = this
}
public
toString
()
{
return
'
Class Wechaty(
'
+
this
.
setting
.
type
+
'
)
'
}
...
...
@@ -113,6 +108,7 @@ export class Wechaty extends EventEmitter implements Sayable {
const
ss
=
require
(
'
child_process
'
)
.
spawnSync
(
gitLogCmd
,
gitLogArgs
,
{
cwd
:
__dirname
})
if
(
ss
.
status
!==
0
)
{
throw
new
Error
(
ss
.
error
)
}
...
...
@@ -121,6 +117,7 @@ export class Wechaty extends EventEmitter implements Sayable {
.
toString
()
.
trim
()
return
`#git[
${
revision
}
]`
}
catch
(
e
)
{
/* fall safe */
/**
* 1. .git not exist
...
...
@@ -208,16 +205,21 @@ export class Wechaty extends EventEmitter implements Sayable {
public
async
initPuppet
():
Promise
<
Puppet
>
{
let
puppet
:
Puppet
if
(
!
this
.
setting
.
head
)
{
throw
new
Error
(
'
no head
'
)
}
switch
(
this
.
setting
.
type
)
{
case
'
web
'
:
puppet
=
new
PuppetWeb
({
head
:
<
HeadName
>
this
.
setting
.
head
head
:
this
.
setting
.
head
,
profile
:
this
.
setting
.
profile
})
break
default
:
throw
new
Error
(
'
Puppet unsupport(yet):
'
+
this
.
setting
.
type
)
throw
new
Error
(
'
Puppet unsupport(yet
?
):
'
+
this
.
setting
.
type
)
}
const
eventList
:
WechatyEventName
[]
=
[
...
...
@@ -250,7 +252,7 @@ export class Wechaty extends EventEmitter implements Sayable {
*/
// set puppet before init, because we need this.puppet if we quit() before init() finish
this
.
puppet
=
puppet
this
.
puppet
=
<
Puppet
>
puppet
// force to use base class Puppet interface for better encapsolation
// set puppet instance to Wechaty Static variable, for using by Contact/Room/Message/FriendRequest etc.
Config
.
puppetInstance
(
puppet
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录