Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d22fe64c
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d22fe64c
编写于
1月 06, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adopt auto-updater module
上级
d2e85a97
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
10 deletion
+17
-10
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+1
-1
src/typings/atom-browser.d.ts
src/typings/atom-browser.d.ts
+2
-2
src/vs/workbench/electron-main/update-manager.ts
src/vs/workbench/electron-main/update-manager.ts
+4
-3
src/vs/workbench/electron-main/win32/auto-updater.win32.ts
src/vs/workbench/electron-main/win32/auto-updater.win32.ts
+10
-4
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
d22fe64c
...
...
@@ -29,7 +29,7 @@ var build = path.join(root, '.build');
var
commit
=
util
.
getVersion
(
root
);
var
baseModules
=
[
'
app
'
,
'
applicationinsights
'
,
'
assert
'
,
'
auto-updater
'
,
'
browser-window
'
,
'
app
licationinsights
'
,
'
assert
'
,
'
browser-window
'
,
'
child_process
'
,
'
chokidar
'
,
'
crash-reporter
'
,
'
crypto
'
,
'
dialog
'
,
'
emmet
'
,
'
events
'
,
'
fs
'
,
'
getmac
'
,
'
glob
'
,
'
graceful-fs
'
,
'
http
'
,
'
http-proxy-agent
'
,
'
https
'
,
'
https-proxy-agent
'
,
'
iconv-lite
'
,
'
electron
'
,
'
ipc
'
,
'
menu
'
,
'
menu-item
'
,
'
net
'
,
...
...
src/typings/atom-browser.d.ts
浏览文件 @
d22fe64c
...
...
@@ -331,7 +331,7 @@ interface IDock {
// https://github.com/atom/electron/blob/master/docs/api/auto-updater.md
declare
module
'
auto-updater
'
{
export
interface
IAutoUpdater
extends
IEventEmitter
{
setFeedU
rl
(
url
:
string
):
void
;
setFeedU
RL
(
url
:
string
):
void
;
checkForUpdates
():
void
;
}
...
...
@@ -342,7 +342,7 @@ declare module 'auto-updater' {
version
?:
string
;
}
export
function
setFeedU
rl
(
url
:
string
):
void
;
export
function
setFeedU
RL
(
url
:
string
):
void
;
export
function
checkForUpdates
():
void
;
export
function
addListener
(
event
:
string
,
listener
:
Function
):
EventEmitter
;
export
function
on
(
event
:
string
,
listener
:
Function
):
EventEmitter
;
...
...
src/vs/workbench/electron-main/update-manager.ts
浏览文件 @
d22fe64c
...
...
@@ -8,6 +8,7 @@ import fs = require('fs');
import
path
=
require
(
'
path
'
);
import
events
=
require
(
'
events
'
);
import
electron
=
require
(
'
electron
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
env
=
require
(
'
vs/workbench/electron-main/env
'
);
import
storage
=
require
(
'
vs/workbench/electron-main/storage
'
);
...
...
@@ -38,7 +39,7 @@ export interface IUpdate {
}
interface
IAutoUpdater
extends
IEventEmitter
{
setFeedU
rl
(
url
:
string
):
void
;
setFeedU
RL
(
url
:
string
):
void
;
checkForUpdates
():
void
;
}
...
...
@@ -67,7 +68,7 @@ export class UpdateManager extends events.EventEmitter {
if
(
platform
.
isWindows
)
{
this
.
raw
=
new
Win32AutoUpdaterImpl
();
}
else
if
(
platform
.
isMacintosh
)
{
this
.
raw
=
<
any
>
require
.
__$__nodeRequire
(
'
auto-updater
'
);
// https://github.com/atom/electron/issues/3194
this
.
raw
=
electron
.
autoUpdater
;
}
if
(
this
.
raw
)
{
...
...
@@ -141,7 +142,7 @@ export class UpdateManager extends events.EventEmitter {
this
.
_channel
=
channel
;
this
.
_feedUrl
=
feedUrl
;
this
.
raw
.
setFeedU
rl
(
feedUrl
);
this
.
raw
.
setFeedU
RL
(
feedUrl
);
this
.
setState
(
State
.
Idle
);
// Check for updates on startup after 30 seconds
...
...
src/vs/workbench/electron-main/win32/auto-updater.win32.ts
浏览文件 @
d22fe64c
...
...
@@ -6,7 +6,6 @@
'
use strict
'
;
import
events
=
require
(
'
events
'
);
import
{
IAutoUpdater
,
IUpdate
}
from
'
auto-updater
'
;
import
path
=
require
(
'
path
'
);
import
os
=
require
(
'
os
'
);
import
cp
=
require
(
'
child_process
'
);
...
...
@@ -19,7 +18,14 @@ import { getProxyAgent } from 'vs/workbench/node/proxy';
import
{
manager
as
Settings
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
manager
as
Lifecycle
}
from
'
vs/workbench/electron-main/lifecycle
'
;
export
class
Win32AutoUpdaterImpl
extends
events
.
EventEmitter
implements
IAutoUpdater
{
export
interface
IUpdate
{
url
:
string
;
name
:
string
;
releaseNotes
?:
string
;
version
?:
string
;
}
export
class
Win32AutoUpdaterImpl
extends
events
.
EventEmitter
{
private
url
:
string
;
private
currentRequest
:
Promise
;
...
...
@@ -36,7 +42,7 @@ export class Win32AutoUpdaterImpl extends events.EventEmitter implements IAutoUp
return
new
TPromise
<
string
>
((
c
,
e
)
=>
mkdirp
(
result
,
null
,
err
=>
err
?
e
(
err
)
:
c
(
result
)));
}
public
setFeedU
rl
(
url
:
string
):
void
{
public
setFeedU
RL
(
url
:
string
):
void
{
this
.
url
=
url
;
}
...
...
@@ -102,7 +108,7 @@ export class Win32AutoUpdaterImpl extends events.EventEmitter implements IAutoUp
}
private
getUpdatePackagePath
(
version
:
string
):
TPromise
<
string
>
{
return
this
.
cachePath
.
then
(
cachePath
=>
path
.
join
(
cachePath
,
`CodeSetup-
${
version
}
.exe`
));
return
this
.
cachePath
.
then
(
cachePath
=>
path
.
join
(
cachePath
,
`CodeSetup-
${
version
}
.exe`
));
}
private
quitAndUpdate
(
updatePackagePath
:
string
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录