Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
myhjmzy
code-server
提交
ccd01c49
C
code-server
项目概览
myhjmzy
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
ccd01c49
编写于
3月 02, 2020
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Integrate update notifications into VS Code
上级
069c5230
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
161 addition
and
75 deletion
+161
-75
ci/vscode.patch
ci/vscode.patch
+67
-5
src/browser/pages/app.html
src/browser/pages/app.html
+1
-1
src/browser/pages/error.html
src/browser/pages/error.html
+2
-2
src/browser/pages/home.html
src/browser/pages/home.html
+1
-1
src/browser/pages/login.html
src/browser/pages/login.html
+1
-1
src/browser/pages/update.css
src/browser/pages/update.css
+14
-0
src/browser/pages/update.html
src/browser/pages/update.html
+5
-3
src/node/app/api.ts
src/node/app/api.ts
+3
-0
src/node/app/app.ts
src/node/app/app.ts
+5
-4
src/node/app/dashboard.ts
src/node/app/dashboard.ts
+7
-9
src/node/app/login.ts
src/node/app/login.ts
+2
-9
src/node/app/static.ts
src/node/app/static.ts
+0
-5
src/node/app/update.ts
src/node/app/update.ts
+40
-27
src/node/http.ts
src/node/http.ts
+11
-6
test/update.test.ts
test/update.test.ts
+2
-2
未找到文件。
ci/vscode.patch
浏览文件 @
ccd01c49
...
...
@@ -444,10 +444,10 @@ index d0f6e6b18a..1966fd297d 100644
-
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
new file mode 100644
index 0000000000..
3a62205b38
index 0000000000..
1e6bca3b52
--- /dev/null
+++ b/src/vs/server/browser/client.ts
@@ -0,0 +1,
162
@@
@@ -0,0 +1,
224
@@
+import { Emitter } from 'vs/base/common/event';
+import { URI } from 'vs/base/common/uri';
+import { localize } from 'vs/nls';
...
...
@@ -455,6 +455,7 @@ index 0000000000..3a62205b38
+import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
+import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
+import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
+import { ILogService } from 'vs/platform/log/common/log';
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
+import { Registry } from 'vs/platform/registry/common/platform';
+import { PersistentConnectionEventType } from 'vs/platform/remote/common/remoteAgentConnection';
...
...
@@ -575,6 +576,67 @@ index 0000000000..3a62205b38
+ }
+ });
+ }
+
+ const applyUpdate = async (): Promise<void> => {
+ (services.get(ILogService) as ILogService).debug("Applying update...");
+
+ const response = await fetch("./update/apply", {
+ headers: { "content-type": "application/json" },
+ });
+ if (response.status !== 200) {
+ throw new Error("Unexpected response");
+ }
+
+ const json = await response.json();
+ if (!json.isLatest) {
+ throw new Error("Update failed");
+ }
+
+ (services.get(INotificationService) as INotificationService).info(`Updated to ${json.version}`);
+ };
+
+ const getUpdate = async (): Promise<void> => {
+ (services.get(ILogService) as ILogService).debug("Checking for update...");
+
+ const response = await fetch("./update", {
+ headers: { "content-type": "application/json" },
+ });
+ if (response.status !== 200) {
+ throw new Error("unexpected response");
+ }
+
+ const json = await response.json();
+ if (json.isLatest) {
+ return;
+ }
+
+ (services.get(INotificationService) as INotificationService).notify({
+ severity: Severity.Info,
+ message: `code-server has an update: ${json.version}`,
+ actions: {
+ primary: [{
+ id: 'update',
+ label: 'Apply Update',
+ tooltip: '',
+ class: undefined,
+ enabled: true,
+ checked: true,
+ dispose: () => undefined,
+ run: applyUpdate,
+ }],
+ }
+ });
+ };
+
+ const updateLoop = (): void => {
+ getUpdate().catch((error) => {
+ (services.get(ILogService) as ILogService).warn(error);
+ }).finally(() => {
+ setTimeout(updateLoop, 300000);
+ });
+ };
+
+ updateLoop();
+};
+
+export interface Query {
...
...
@@ -2968,7 +3030,7 @@ index bbb72e9511..0785d3391d 100644
-registerSingleton(IExtensionStoragePaths, class extends NotImplementedProxy(IExtensionStoragePaths) { whenReady = Promise.resolve(); });
+registerSingleton(IExtensionStoragePaths, ExtensionStoragePaths);
diff --git a/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts b/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts
index 79455414c0..
a407593b4d
100644
index 79455414c0..
8931c1355a
100644
--- a/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts
+++ b/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts
@@ -14,7 +14,11 @@
...
...
@@ -2978,8 +3040,8 @@ index 79455414c0..a407593b4d 100644
- catchError: true
+ catchError: true,
+ paths: {
+ '@coder/node-browser': `
..
/node_modules/@coder/node-browser/out/client/client.js`,
+ '@coder/requirefs': `
..
/node_modules/@coder/requirefs/out/requirefs.js`,
+ '@coder/node-browser': `
{{BASE}}/static/{{COMMIT}}/lib/vscode
/node_modules/@coder/node-browser/out/client/client.js`,
+ '@coder/requirefs': `
{{BASE}}/static/{{COMMIT}}/lib/vscode
/node_modules/@coder/requirefs/out/requirefs.js`,
+ }
});
...
...
src/browser/pages/app.html
浏览文件 @
ccd01c49
...
...
@@ -15,7 +15,7 @@
crossorigin=
"use-credentials"
/>
<link
rel=
"apple-touch-icon"
href=
"{{BASE}}/static/{{COMMIT}}/src/browser/media/code-server.png"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/app.css"
rel=
"stylesheet"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/
pages/
app.css"
rel=
"stylesheet"
/>
<meta
id=
"coder-options"
data-settings=
"{{OPTIONS}}"
/>
</head>
<body>
...
...
src/browser/pages/error.html
浏览文件 @
ccd01c49
...
...
@@ -15,7 +15,7 @@
crossorigin=
"use-credentials"
/>
<link
rel=
"apple-touch-icon"
href=
"{{BASE}}/static/{{COMMIT}}/src/browser/media/code-server.png"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/app.css"
rel=
"stylesheet"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/
pages/
app.css"
rel=
"stylesheet"
/>
<meta
id=
"coder-options"
data-settings=
"{{OPTIONS}}"
/>
</head>
<body>
...
...
@@ -26,7 +26,7 @@
{{ERROR_BODY}}
</div>
<div
class=
"links"
>
<a
class=
"link"
href=
"{{BASE}}"
>
go home
</a>
<a
class=
"link"
href=
"{{BASE}}
{{TO}}
"
>
go home
</a>
</div>
</div>
</div>
...
...
src/browser/pages/home.html
浏览文件 @
ccd01c49
...
...
@@ -15,7 +15,7 @@
crossorigin=
"use-credentials"
/>
<link
rel=
"apple-touch-icon"
href=
"{{BASE}}/static/{{COMMIT}}/src/browser/media/code-server.png"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/app.css"
rel=
"stylesheet"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/
pages/
app.css"
rel=
"stylesheet"
/>
<meta
id=
"coder-options"
data-settings=
"{{OPTIONS}}"
/>
</head>
<body>
...
...
src/browser/pages/login.html
浏览文件 @
ccd01c49
...
...
@@ -18,7 +18,7 @@
crossorigin=
"use-credentials"
/>
<link
rel=
"apple-touch-icon"
href=
"{{BASE}}/static/{{COMMIT}}/src/browser/media/code-server.png"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/app.css"
rel=
"stylesheet"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/
pages/
app.css"
rel=
"stylesheet"
/>
<meta
id=
"coder-options"
data-settings=
"{{OPTIONS}}"
/>
</head>
<body>
...
...
src/browser/pages/update.css
浏览文件 @
ccd01c49
...
...
@@ -10,3 +10,17 @@
color
:
red
;
margin-top
:
16px
;
}
.update-form
>
.links
{
margin-top
:
20px
;
}
.update-form
>
.links
>
.link
{
color
:
rgb
(
87
,
114
,
245
);
text-align
:
center
;
text-decoration
:
none
;
}
.update-form
>
.links
>
.link
:hover
{
text-decoration
:
underline
;
}
src/browser/pages/update.html
浏览文件 @
ccd01c49
...
...
@@ -15,7 +15,7 @@
crossorigin=
"use-credentials"
/>
<link
rel=
"apple-touch-icon"
href=
"{{BASE}}/static/{{COMMIT}}/src/browser/media/code-server.png"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/app.css"
rel=
"stylesheet"
/>
<link
href=
"{{BASE}}/static/{{COMMIT}}/dist/
pages/
app.css"
rel=
"stylesheet"
/>
<meta
id=
"coder-options"
data-settings=
"{{OPTIONS}}"
/>
</head>
<body>
...
...
@@ -26,9 +26,11 @@
<div
class=
"sub"
>
Update code-server.
</div>
</div>
<div
class=
"content"
>
<form
class=
"update-form"
method=
"post
"
>
<form
class=
"update-form"
action=
"{{BASE}}/update/apply
"
>
{{UPDATE_STATUS}} {{ERROR}}
<a
class=
"cancel -button"
href=
"{{BASE}}"
>
Cancel
</a>
<div
class=
"links"
>
<a
class=
"link"
href=
"{{BASE}}{{TO}}"
>
go home
</a>
</div>
</form>
</div>
</div>
...
...
src/node/app/api.ts
浏览文件 @
ccd01c49
...
...
@@ -59,6 +59,9 @@ export class ApiHttpProvider extends HttpProvider {
public
async
handleRequest
(
route
:
Route
,
request
:
http
.
IncomingMessage
):
Promise
<
HttpResponse
>
{
this
.
ensureAuthenticated
(
request
)
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
switch
(
route
.
base
)
{
case
ApiEndpoint
.
applications
:
...
...
src/node/app/app.ts
浏览文件 @
ccd01c49
...
...
@@ -16,6 +16,11 @@ export class AppHttpProvider extends HttpProvider {
return
{
redirect
:
"
/login
"
,
query
:
{
to
:
route
.
fullPath
}
}
}
this
.
ensureMethod
(
request
)
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
// Run an existing app, but if it doesn't exist go ahead and start it.
let
app
=
this
.
api
.
getRunningApplication
(
route
.
base
)
let
sessionId
=
app
&&
app
.
sessionId
...
...
@@ -38,8 +43,4 @@ export class AppHttpProvider extends HttpProvider {
response
.
content
=
response
.
content
.
replace
(
/{{APP_NAME}}/
,
name
)
return
this
.
replaceTemplates
(
route
,
response
,
sessionId
)
}
public
async
handleWebSocket
():
Promise
<
true
>
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
}
src/node/app/dashboard.ts
浏览文件 @
ccd01c49
...
...
@@ -20,10 +20,14 @@ export class DashboardHttpProvider extends HttpProvider {
}
public
async
handleRequest
(
route
:
Route
,
request
:
http
.
IncomingMessage
):
Promise
<
HttpResponse
>
{
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
switch
(
route
.
base
)
{
case
"
/delete
"
:
{
this
.
ensureMethod
(
request
,
"
POST
"
)
this
.
ensureAuthenticated
(
request
)
this
.
ensureMethod
(
request
,
"
POST
"
)
const
data
=
await
this
.
getData
(
request
)
const
p
=
data
?
querystring
.
parse
(
data
)
:
{}
this
.
api
.
deleteSession
(
p
.
sessionId
as
string
)
...
...
@@ -32,9 +36,7 @@ export class DashboardHttpProvider extends HttpProvider {
case
"
/
"
:
{
this
.
ensureMethod
(
request
)
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
else
if
(
!
this
.
authenticated
(
request
))
{
if
(
!
this
.
authenticated
(
request
))
{
return
{
redirect
:
"
/login
"
,
query
:
{
to
:
this
.
options
.
base
}
}
}
return
this
.
getRoot
(
route
)
...
...
@@ -69,10 +71,6 @@ export class DashboardHttpProvider extends HttpProvider {
return
this
.
replaceTemplates
(
route
,
response
)
}
public
async
handleWebSocket
():
Promise
<
true
>
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
private
getRecentProjectRows
(
base
:
string
,
recents
:
RecentResponse
):
string
{
return
recents
.
paths
.
length
>
0
||
recents
.
workspaces
.
length
>
0
?
recents
.
paths
.
map
((
recent
)
=>
this
.
getRecentProjectRow
(
base
,
recent
)).
join
(
"
\n
"
)
+
...
...
@@ -151,7 +149,7 @@ export class DashboardHttpProvider extends HttpProvider {
</div>
<div class="item">
${
humanize
(
update
.
checked
)}
<a class="sub -link" href="
${
base
}
/update">Update now</a>
<a class="sub -link" href="
${
base
}
/update
?to=
${
this
.
options
.
base
}
">Update now</a>
</div>
<div class="item" >Current:
${
this
.
update
.
currentVersion
}
</div>
</div>`
...
...
src/node/app/login.ts
浏览文件 @
ccd01c49
...
...
@@ -18,17 +18,14 @@ interface LoginPayload {
*/
export
class
LoginHttpProvider
extends
HttpProvider
{
public
async
handleRequest
(
route
:
Route
,
request
:
http
.
IncomingMessage
):
Promise
<
HttpResponse
>
{
if
(
this
.
options
.
auth
!==
AuthType
.
Password
)
{
if
(
this
.
options
.
auth
!==
AuthType
.
Password
||
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
switch
(
route
.
base
)
{
case
"
/
"
:
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
switch
(
request
.
method
)
{
case
"
POST
"
:
this
.
ensureMethod
(
request
,
[
"
GET
"
,
"
POST
"
])
return
this
.
tryLogin
(
route
,
request
)
default
:
this
.
ensureMethod
(
request
)
...
...
@@ -110,8 +107,4 @@ export class LoginHttpProvider extends HttpProvider {
throw
new
Error
(
"
Missing password
"
)
}
public
async
handleWebSocket
():
Promise
<
undefined
>
{
return
undefined
}
}
src/node/app/static.ts
浏览文件 @
ccd01c49
import
*
as
http
from
"
http
"
import
{
HttpCode
,
HttpError
}
from
"
../../common/http
"
import
{
HttpProvider
,
HttpResponse
,
Route
}
from
"
../http
"
/**
...
...
@@ -32,8 +31,4 @@ export class StaticHttpProvider extends HttpProvider {
}
return
this
.
getResource
(
this
.
rootPath
,
...
split
)
}
public
async
handleWebSocket
():
Promise
<
true
>
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
}
src/node/app/update.ts
浏览文件 @
ccd01c49
...
...
@@ -59,10 +59,14 @@ export class UpdateHttpProvider extends HttpProvider {
public
async
handleRequest
(
route
:
Route
,
request
:
http
.
IncomingMessage
):
Promise
<
HttpResponse
>
{
this
.
ensureAuthenticated
(
request
)
this
.
ensureMethod
(
request
)
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
switch
(
route
.
base
)
{
case
"
/check
"
:
this
.
ensureMethod
(
request
)
this
.
getUpdate
(
true
)
if
(
route
.
query
&&
route
.
query
.
to
)
{
return
{
...
...
@@ -70,37 +74,45 @@ export class UpdateHttpProvider extends HttpProvider {
query
:
{
to
:
undefined
},
}
}
return
this
.
getRoot
(
route
)
case
"
/
"
:
{
this
.
ensureMethod
(
request
,
[
"
GET
"
,
"
POST
"
])
if
(
route
.
requestPath
!==
"
/index.html
"
)
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
switch
(
request
.
method
)
{
case
"
GET
"
:
return
this
.
getRoot
(
route
)
case
"
POST
"
:
return
this
.
tryUpdate
(
route
)
}
}
return
this
.
getRoot
(
route
,
request
)
case
"
/apply
"
:
return
this
.
tryUpdate
(
route
,
request
)
case
"
/
"
:
return
this
.
getRoot
(
route
,
request
)
}
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
public
async
getRoot
(
route
:
Route
,
error
?:
Error
):
Promise
<
HttpResponse
>
{
public
async
getRoot
(
route
:
Route
,
request
:
http
.
IncomingMessage
,
appliedUpdate
?:
string
,
error
?:
Error
,
):
Promise
<
HttpResponse
>
{
if
(
request
.
headers
[
"
content-type
"
]
===
"
application/json
"
)
{
if
(
!
this
.
enabled
)
{
return
{
content
:
{
isLatest
:
true
,
},
}
}
const
update
=
await
this
.
getUpdate
()
return
{
content
:
{
...
update
,
isLatest
:
this
.
isLatestVersion
(
update
),
},
}
}
const
response
=
await
this
.
getUtf8Resource
(
this
.
rootPath
,
"
src/browser/pages/update.html
"
)
response
.
content
=
response
.
content
.
replace
(
/{{UPDATE_STATUS}}/
,
await
this
.
getUpdateHtml
())
.
replace
(
/{{UPDATE_STATUS}}/
,
a
ppliedUpdate
?
`Updated to
${
appliedUpdate
}
`
:
a
wait
this
.
getUpdateHtml
())
.
replace
(
/{{ERROR}}/
,
error
?
`<div class="error">
${
error
.
message
}
</div>`
:
""
)
return
this
.
replaceTemplates
(
route
,
response
)
}
public
async
handleWebSocket
():
Promise
<
true
>
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
/**
* Query for and return the latest update.
*/
...
...
@@ -163,25 +175,26 @@ export class UpdateHttpProvider extends HttpProvider {
const
update
=
await
this
.
getUpdate
()
if
(
this
.
isLatestVersion
(
update
))
{
throw
new
Error
(
"
No update available
"
)
return
"
No update available
"
}
return
`<button type="submit" class="apply -button">Update to
${
update
.
version
}
</button>`
}
public
async
tryUpdate
(
route
:
Route
):
Promise
<
HttpResponse
>
{
public
async
tryUpdate
(
route
:
Route
,
request
:
http
.
IncomingMessage
):
Promise
<
HttpResponse
>
{
try
{
const
update
=
await
this
.
getUpdate
()
if
(
!
this
.
isLatestVersion
(
update
))
{
await
this
.
downloadUpdate
(
update
)
await
this
.
downloadAndApplyUpdate
(
update
)
return
this
.
getRoot
(
route
,
request
,
update
.
version
)
}
return
this
.
getRoot
(
route
)
return
this
.
getRoot
(
route
,
request
)
}
catch
(
error
)
{
return
this
.
getRoot
(
route
,
error
)
return
this
.
getRoot
(
route
,
request
,
undefined
,
error
)
}
}
public
async
downloadUpdate
(
update
:
Update
,
targetPath
?:
string
,
target
?:
string
):
Promise
<
void
>
{
public
async
download
AndApply
Update
(
update
:
Update
,
targetPath
?:
string
,
target
?:
string
):
Promise
<
void
>
{
const
releaseName
=
await
this
.
getReleaseName
(
update
,
target
)
const
url
=
this
.
downloadUrl
.
replace
(
"
{{VERSION}}
"
,
update
.
version
).
replace
(
"
{{RELEASE_NAME}}
"
,
releaseName
)
...
...
src/node/http.ts
浏览文件 @
ccd01c49
...
...
@@ -140,12 +140,16 @@ export abstract class HttpProvider {
/**
* Handle web sockets on the registered endpoint.
*/
public
abstract
handleWebSocket
(
route
:
Route
,
request
:
http
.
IncomingMessage
,
socket
:
net
.
Socket
,
head
:
Buffer
,
):
Promise
<
true
|
undefined
>
public
handleWebSocket
(
/* eslint-disable @typescript-eslint/no-unused-vars */
_route
:
Route
,
_request
:
http
.
IncomingMessage
,
_socket
:
net
.
Socket
,
_head
:
Buffer
,
/* eslint-enable @typescript-eslint/no-unused-vars */
):
Promise
<
true
|
undefined
>
{
throw
new
HttpError
(
"
Not found
"
,
HttpCode
.
NotFound
)
}
/**
* Handle requests to the registered endpoint.
...
...
@@ -194,6 +198,7 @@ export abstract class HttpProvider {
}
response
.
content
=
response
.
content
.
replace
(
/{{COMMIT}}/g
,
this
.
options
.
commit
)
.
replace
(
/{{TO}}/g
,
Array
.
isArray
(
route
.
query
.
to
)
?
route
.
query
.
to
[
0
]
:
route
.
query
.
to
||
"
/dashboard
"
)
.
replace
(
/{{BASE}}/g
,
this
.
base
(
route
))
.
replace
(
/"{{OPTIONS}}"/
,
`'
${
JSON
.
stringify
(
options
)}
'`
)
return
response
...
...
test/update.test.ts
浏览文件 @
ccd01c49
...
...
@@ -205,12 +205,12 @@ describe("update", () => {
assert
.
equal
(
`console.log("OLD")`
,
await
fs
.
readFile
(
entry
,
"
utf8
"
))
// Updating should replace the existing version.
await
p
.
downloadUpdate
(
update
,
destination
,
"
linux
"
)
await
p
.
download
AndApply
Update
(
update
,
destination
,
"
linux
"
)
assert
.
equal
(
`console.log("UPDATED")`
,
await
fs
.
readFile
(
entry
,
"
utf8
"
))
// Should still work if there is no existing version somehow.
await
fs
.
remove
(
destination
)
await
p
.
downloadUpdate
(
update
,
destination
,
"
linux
"
)
await
p
.
download
AndApply
Update
(
update
,
destination
,
"
linux
"
)
assert
.
equal
(
`console.log("UPDATED")`
,
await
fs
.
readFile
(
entry
,
"
utf8
"
))
assert
.
deepEqual
(
spy
,
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录