Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
2adf526f
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
2adf526f
编写于
8月 19, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove env.createPaths
上级
eb7161d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
14 deletion
+8
-14
src/vs/code/electron-main/env.ts
src/vs/code/electron-main/env.ts
+0
-12
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+7
-1
src/vs/code/node/cliProcessMain.ts
src/vs/code/node/cliProcessMain.ts
+1
-1
未找到文件。
src/vs/code/electron-main/env.ts
浏览文件 @
2adf526f
...
...
@@ -9,11 +9,9 @@ import * as fs from 'original-fs';
import
*
as
path
from
'
path
'
;
import
*
as
os
from
'
os
'
;
import
{
app
}
from
'
electron
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
...
...
@@ -34,7 +32,6 @@ export const IEnvService = createDecorator<IEnvService>('mainEnvironmentService'
export
interface
IEnvService
{
_serviceBrand
:
any
;
cliArgs
:
ICommandLineArguments
;
userExtensionsHome
:
string
;
isTestingFromCli
:
boolean
;
isBuilt
:
boolean
;
product
:
IProductConfiguration
;
...
...
@@ -47,8 +44,6 @@ export interface IEnvService {
appSettingsHome
:
string
;
appSettingsPath
:
string
;
appKeybindingsPath
:
string
;
createPaths
():
TPromise
<
void
>
;
}
export
class
EnvService
implements
IEnvService
{
...
...
@@ -138,13 +133,6 @@ export class EnvService implements IEnvService {
this
.
_userHome
=
path
.
join
(
os
.
homedir
(),
product
.
dataFolderName
);
this
.
_userExtensionsHome
=
this
.
cliArgs
.
extensionHomePath
||
path
.
join
(
this
.
_userHome
,
'
extensions
'
);
}
createPaths
():
TPromise
<
void
>
{
const
promises
=
[
this
.
appSettingsHome
,
this
.
userHome
,
this
.
userExtensionsHome
]
.
map
(
p
=>
mkdirp
(
p
));
return
TPromise
.
join
(
promises
)
as
TPromise
<
any
>
;
}
}
function
parsePathArguments
(
cwd
:
string
,
args
:
string
[],
gotoLineMode
?:
boolean
):
string
[]
{
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
2adf526f
...
...
@@ -11,6 +11,7 @@ import { app, ipcMain as ipc } from 'electron';
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
parseArgs
}
from
'
vs/code/node/argv
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
import
{
IProcessEnvironment
,
IEnvService
,
EnvService
}
from
'
vs/code/electron-main/env
'
;
import
{
IWindowsService
,
WindowsManager
}
from
'
vs/code/electron-main/windows
'
;
import
{
ILifecycleService
,
LifecycleService
}
from
'
vs/code/electron-main/lifecycle
'
;
...
...
@@ -385,12 +386,17 @@ function getEnvironment(): TPromise<IEnv> {
});
}
function
createPaths
(
environmentService
:
IEnvironmentService
):
TPromise
<
any
>
{
const
paths
=
[
environmentService
.
appSettingsHome
,
environmentService
.
userHome
,
environmentService
.
extensionsPath
];
return
TPromise
.
join
(
paths
.
map
(
p
=>
mkdirp
(
p
)))
as
TPromise
<
any
>
;
}
// On some platforms we need to manually read from the global environment variables
// and assign them to the process environment (e.g. when doubleclick app on Mac)
getEnvironment
().
then
(
env
=>
{
assign
(
process
.
env
,
env
);
return
instantiationService
.
invokeFunction
(
a
=>
a
.
get
(
IEnvService
).
createPaths
(
))
return
instantiationService
.
invokeFunction
(
a
=>
createPaths
(
a
.
get
(
IEnvironmentService
)
))
.
then
(()
=>
instantiationService
.
invokeFunction
(
setupIPC
))
.
then
(
mainIpcServer
=>
instantiationService
.
invokeFunction
(
main
,
mainIpcServer
,
env
));
})
...
...
src/vs/code/node/cliProcessMain.ts
浏览文件 @
2adf526f
...
...
@@ -153,7 +153,7 @@ export function main(argv: ParsedArgs): TPromise<void> {
return
instantiationService
.
invokeFunction
(
accessor
=>
{
const
envService
=
accessor
.
get
(
IEnvironmentService
);
return
TPromise
.
join
([
envService
.
userHome
,
envService
.
extensionsPath
].
map
(
p
=>
mkdirp
(
p
))).
then
(()
=>
{
return
TPromise
.
join
([
envService
.
appSettingsHome
,
envService
.
userHome
,
envService
.
extensionsPath
].
map
(
p
=>
mkdirp
(
p
))).
then
(()
=>
{
const
{
appRoot
,
extensionsPath
,
extensionDevelopmentPath
,
isBuilt
}
=
envService
;
const
services
=
new
ServiceCollection
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录