Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
764cd960
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
764cd960
编写于
2月 13, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #68208
上级
6850012c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
14 deletion
+9
-14
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+0
-2
src/vs/base/node/test/fixtures/extract.zip
src/vs/base/node/test/fixtures/extract.zip
+0
-0
src/vs/base/node/test/zip.test.ts
src/vs/base/node/test/zip.test.ts
+2
-3
src/vs/base/node/zip.ts
src/vs/base/node/zip.ts
+4
-6
src/vs/platform/extensionManagement/node/extensionManagementService.ts
...rm/extensionManagement/node/extensionManagementService.ts
+2
-2
src/vs/platform/extensionManagement/node/extensionManagementUtil.ts
...tform/extensionManagement/node/extensionManagementUtil.ts
+1
-1
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
764cd960
...
@@ -319,8 +319,6 @@
...
@@ -319,8 +319,6 @@
"./vs/platform/menubar/node/menubarIpc.ts"
,
"./vs/platform/menubar/node/menubarIpc.ts"
,
"./vs/platform/node/package.ts"
,
"./vs/platform/node/package.ts"
,
"./vs/platform/node/product.ts"
,
"./vs/platform/node/product.ts"
,
"./vs/platform/node/test/zip.test.ts"
,
"./vs/platform/node/zip.ts"
,
"./vs/platform/notification/common/notification.ts"
,
"./vs/platform/notification/common/notification.ts"
,
"./vs/platform/notification/test/common/testNotificationService.ts"
,
"./vs/platform/notification/test/common/testNotificationService.ts"
,
"./vs/platform/opener/common/opener.ts"
,
"./vs/platform/opener/common/opener.ts"
,
...
...
src/vs/
platform
/node/test/fixtures/extract.zip
→
src/vs/
base
/node/test/fixtures/extract.zip
浏览文件 @
764cd960
文件已移动
src/vs/
platform
/node/test/zip.test.ts
→
src/vs/
base
/node/test/zip.test.ts
浏览文件 @
764cd960
...
@@ -6,10 +6,9 @@
...
@@ -6,10 +6,9 @@
import
*
as
assert
from
'
assert
'
;
import
*
as
assert
from
'
assert
'
;
import
*
as
path
from
'
vs/base/common/path
'
;
import
*
as
path
from
'
vs/base/common/path
'
;
import
*
as
os
from
'
os
'
;
import
*
as
os
from
'
os
'
;
import
{
extract
}
from
'
vs/
platform
/node/zip
'
;
import
{
extract
}
from
'
vs/
base
/node/zip
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
{
rimraf
,
exists
}
from
'
vs/base/node/pfs
'
;
import
{
rimraf
,
exists
}
from
'
vs/base/node/pfs
'
;
import
{
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
import
{
createCancelablePromise
}
from
'
vs/base/common/async
'
;
import
{
createCancelablePromise
}
from
'
vs/base/common/async
'
;
...
@@ -21,7 +20,7 @@ suite('Zip', () => {
...
@@ -21,7 +20,7 @@ suite('Zip', () => {
const
fixture
=
path
.
join
(
fixtures
,
'
extract.zip
'
);
const
fixture
=
path
.
join
(
fixtures
,
'
extract.zip
'
);
const
target
=
path
.
join
(
os
.
tmpdir
(),
generateUuid
());
const
target
=
path
.
join
(
os
.
tmpdir
(),
generateUuid
());
return
createCancelablePromise
(
token
=>
extract
(
fixture
,
target
,
{},
new
NullLogService
(),
token
)
return
createCancelablePromise
(
token
=>
extract
(
fixture
,
target
,
{},
token
)
.
then
(()
=>
exists
(
path
.
join
(
target
,
'
extension
'
)))
.
then
(()
=>
exists
(
path
.
join
(
target
,
'
extension
'
)))
.
then
(
exists
=>
assert
(
exists
))
.
then
(
exists
=>
assert
(
exists
))
.
then
(()
=>
rimraf
(
target
)));
.
then
(()
=>
rimraf
(
target
)));
...
...
src/vs/
platform
/node/zip.ts
→
src/vs/
base
/node/zip.ts
浏览文件 @
764cd960
...
@@ -11,14 +11,13 @@ import { nfcall, ninvoke, Sequencer, createCancelablePromise } from 'vs/base/com
...
@@ -11,14 +11,13 @@ import { nfcall, ninvoke, Sequencer, createCancelablePromise } from 'vs/base/com
import
{
mkdirp
,
rimraf
}
from
'
vs/base/node/pfs
'
;
import
{
mkdirp
,
rimraf
}
from
'
vs/base/node/pfs
'
;
import
{
open
as
_openZip
,
Entry
,
ZipFile
}
from
'
yauzl
'
;
import
{
open
as
_openZip
,
Entry
,
ZipFile
}
from
'
yauzl
'
;
import
*
as
yazl
from
'
yazl
'
;
import
*
as
yazl
from
'
yazl
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
export
interface
IExtractOptions
{
export
interface
IExtractOptions
{
overwrite
?:
boolean
;
overwrite
?:
boolean
;
/**
/**
* Source path within the ZIP archive. Only the files contained in this
* Source path within the ZIP archive. Only the files contained in this
* path will be extracted.
* path will be extracted.
*/
*/
...
@@ -104,12 +103,11 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
...
@@ -104,12 +103,11 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
}));
}));
}
}
function
extractZip
(
zipfile
:
ZipFile
,
targetPath
:
string
,
options
:
IOptions
,
logService
:
ILogService
,
token
:
CancellationToken
):
Promise
<
void
>
{
function
extractZip
(
zipfile
:
ZipFile
,
targetPath
:
string
,
options
:
IOptions
,
token
:
CancellationToken
):
Promise
<
void
>
{
let
last
=
createCancelablePromise
<
void
>
(()
=>
Promise
.
resolve
());
let
last
=
createCancelablePromise
<
void
>
(()
=>
Promise
.
resolve
());
let
extractedEntriesCount
=
0
;
let
extractedEntriesCount
=
0
;
Event
.
once
(
token
.
onCancellationRequested
)(()
=>
{
Event
.
once
(
token
.
onCancellationRequested
)(()
=>
{
logService
.
debug
(
targetPath
,
'
Cancelled.
'
);
last
.
cancel
();
last
.
cancel
();
zipfile
.
close
();
zipfile
.
close
();
});
});
...
@@ -195,7 +193,7 @@ export function zip(zipPath: string, files: IFile[]): Promise<string> {
...
@@ -195,7 +193,7 @@ export function zip(zipPath: string, files: IFile[]): Promise<string> {
});
});
}
}
export
function
extract
(
zipPath
:
string
,
targetPath
:
string
,
options
:
IExtractOptions
=
{},
logService
:
ILogService
,
token
:
CancellationToken
):
Promise
<
void
>
{
export
function
extract
(
zipPath
:
string
,
targetPath
:
string
,
options
:
IExtractOptions
=
{},
token
:
CancellationToken
):
Promise
<
void
>
{
const
sourcePathRegex
=
new
RegExp
(
options
.
sourcePath
?
`^
${
options
.
sourcePath
}
`
:
''
);
const
sourcePathRegex
=
new
RegExp
(
options
.
sourcePath
?
`^
${
options
.
sourcePath
}
`
:
''
);
let
promise
=
openZip
(
zipPath
,
true
);
let
promise
=
openZip
(
zipPath
,
true
);
...
@@ -204,7 +202,7 @@ export function extract(zipPath: string, targetPath: string, options: IExtractOp
...
@@ -204,7 +202,7 @@ export function extract(zipPath: string, targetPath: string, options: IExtractOp
promise
=
promise
.
then
(
zipfile
=>
rimraf
(
targetPath
).
then
(()
=>
zipfile
));
promise
=
promise
.
then
(
zipfile
=>
rimraf
(
targetPath
).
then
(()
=>
zipfile
));
}
}
return
promise
.
then
(
zipfile
=>
extractZip
(
zipfile
,
targetPath
,
{
sourcePathRegex
},
logService
,
token
));
return
promise
.
then
(
zipfile
=>
extractZip
(
zipfile
,
targetPath
,
{
sourcePathRegex
},
token
));
}
}
function
read
(
zipPath
:
string
,
filePath
:
string
):
Promise
<
Readable
>
{
function
read
(
zipPath
:
string
,
filePath
:
string
):
Promise
<
Readable
>
{
...
...
src/vs/platform/extensionManagement/node/extensionManagementService.ts
浏览文件 @
764cd960
...
@@ -9,7 +9,7 @@ import * as pfs from 'vs/base/node/pfs';
...
@@ -9,7 +9,7 @@ import * as pfs from 'vs/base/node/pfs';
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
toDisposable
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
toDisposable
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
import
{
extract
,
ExtractError
,
zip
,
IFile
}
from
'
vs/
platform
/node/zip
'
;
import
{
extract
,
ExtractError
,
zip
,
IFile
}
from
'
vs/
base
/node/zip
'
;
import
{
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
ILocalExtension
,
IExtensionManagementService
,
IExtensionGalleryService
,
ILocalExtension
,
IGalleryExtension
,
IGalleryMetadata
,
IGalleryExtension
,
IGalleryMetadata
,
...
@@ -472,7 +472,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
...
@@ -472,7 +472,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
this
.
logService
.
trace
(
`Started extracting the extension from
${
zipPath
}
to
${
extractPath
}
`
);
this
.
logService
.
trace
(
`Started extracting the extension from
${
zipPath
}
to
${
extractPath
}
`
);
return
pfs
.
rimraf
(
extractPath
)
return
pfs
.
rimraf
(
extractPath
)
.
then
(
.
then
(
()
=>
extract
(
zipPath
,
extractPath
,
{
sourcePath
:
'
extension
'
,
overwrite
:
true
},
t
his
.
logService
,
t
oken
)
()
=>
extract
(
zipPath
,
extractPath
,
{
sourcePath
:
'
extension
'
,
overwrite
:
true
},
token
)
.
then
(
.
then
(
()
=>
this
.
logService
.
info
(
`Extracted extension to
${
extractPath
}
:`
,
identifier
.
id
),
()
=>
this
.
logService
.
info
(
`Extracted extension to
${
extractPath
}
:`
,
identifier
.
id
),
e
=>
pfs
.
rimraf
(
extractPath
).
finally
(()
=>
null
)
e
=>
pfs
.
rimraf
(
extractPath
).
finally
(()
=>
null
)
...
...
src/vs/platform/extensionManagement/node/extensionManagementUtil.ts
浏览文件 @
764cd960
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
{
buffer
}
from
'
vs/
platform
/node/zip
'
;
import
{
buffer
}
from
'
vs/
base
/node/zip
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IExtensionManifest
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IExtensionManifest
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录