Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
myhjmzy
code-server
提交
0aa98279
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,发现更多精彩内容 >>
未验证
提交
0aa98279
编写于
9月 09, 2020
作者:
A
Anmol Sethi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes for CI
上级
55a7e8b5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
25 deletion
+31
-25
src/node/cli.ts
src/node/cli.ts
+23
-17
src/node/coder-cloud.ts
src/node/coder-cloud.ts
+8
-8
未找到文件。
src/node/cli.ts
浏览文件 @
0aa98279
...
...
@@ -48,7 +48,7 @@ export interface Args extends VsArgs {
readonly
"
reuse-window
"
?:
boolean
readonly
"
new-window
"
?:
boolean
readonly
"
expose
"
?:
OptionalString
readonly
expose
?:
OptionalString
}
interface
Option
<
T
>
{
...
...
@@ -131,8 +131,9 @@ const options: Options<Required<Args>> = {
force
:
{
type
:
"
boolean
"
,
description
:
"
Avoid prompts when installing VS Code extensions.
"
},
"
install-extension
"
:
{
type
:
"
string[]
"
,
description
:
"
Install or update a VS Code extension by id or vsix. The identifier of an extension is `${publisher}.${name}`.
\n
"
+
"
To install a specific version provide `@${version}`. For example: 'vscode.csharp@1.2.3'.
"
,
description
:
"
Install or update a VS Code extension by id or vsix. The identifier of an extension is `${publisher}.${name}`.
\n
"
+
"
To install a specific version provide `@${version}`. For example: 'vscode.csharp@1.2.3'.
"
,
},
"
enable-proposed-api
"
:
{
type
:
"
string[]
"
,
...
...
@@ -158,13 +159,13 @@ const options: Options<Required<Args>> = {
log
:
{
type
:
LogLevel
},
verbose
:
{
type
:
"
boolean
"
,
short
:
"
vvv
"
,
description
:
"
Enable verbose logging.
"
},
"
expose
"
:
{
expose
:
{
type
:
OptionalString
,
description
:
`
Securely expose code-server via Coder Cloud with the passed name. You'll get a URL like
https://myname.coder-cloud.com at which you can easily access your code-server instance.
Authorization is done via GitHub. Only the first code-server spawned with the current
configuration will be accessible.`
configuration will be accessible.`
,
},
}
...
...
@@ -177,18 +178,23 @@ export const optionDescriptions = (): string[] => {
}),
{
short
:
0
,
long
:
0
},
)
return
entries
.
map
(
([
k
,
v
])
=>
{
let
help
=
`
${
"
"
.
repeat
(
widths
.
short
-
(
v
.
short
?
v
.
short
.
length
:
0
))}${
v
.
short
?
`-
${
v
.
short
}
`
:
"
"
}
--
${
k
}
`
return
help
+
v
.
description
?.
trim
().
split
(
/
\n
/
).
map
((
line
,
i
)
=>
{
line
=
line
.
trim
()
if
(
i
==
0
)
{
return
"
"
.
repeat
(
widths
.
long
-
k
.
length
)
+
line
}
return
"
"
.
repeat
(
widths
.
long
+
widths
.
short
+
6
)
+
line
}).
join
(
"
\n
"
)
},
)
return
entries
.
map
(([
k
,
v
])
=>
{
const
help
=
`
${
"
"
.
repeat
(
widths
.
short
-
(
v
.
short
?
v
.
short
.
length
:
0
))}${
v
.
short
?
`-
${
v
.
short
}
`
:
"
"
}
--
${
k
}
`
return
(
help
+
v
.
description
?.
trim
()
.
split
(
/
\n
/
)
.
map
((
line
,
i
)
=>
{
line
=
line
.
trim
()
if
(
i
===
0
)
{
return
"
"
.
repeat
(
widths
.
long
-
k
.
length
)
+
line
}
return
"
"
.
repeat
(
widths
.
long
+
widths
.
short
+
6
)
+
line
})
.
join
(
"
\n
"
)
)
})
}
export
const
parse
=
(
...
...
src/node/coder-cloud.ts
浏览文件 @
0aa98279
import
{
spawn
}
from
"
child_process
"
import
path
from
"
path
"
import
{
logger
}
from
"
@coder/logger
"
import
split2
from
"
split2
"
import
{
spawn
}
from
"
child_process
"
import
delay
from
"
delay
"
import
fs
from
"
fs
"
import
path
from
"
path
"
import
split2
from
"
split2
"
import
{
promisify
}
from
"
util
"
import
xdgBasedir
from
"
xdg-basedir
"
...
...
@@ -14,7 +14,7 @@ export async function coderCloudExpose(serverName: string): Promise<void> {
stdio
:
[
"
inherit
"
,
"
inherit
"
,
"
pipe
"
],
})
agent
.
stderr
.
pipe
(
split2
()).
on
(
"
data
"
,
line
=>
{
agent
.
stderr
.
pipe
(
split2
()).
on
(
"
data
"
,
(
line
)
=>
{
line
=
line
.
replace
(
/^
[
0-9-
]
+
[
0-9:
]
+
[^
]
+
\t
/
,
""
)
logger
.
info
(
line
)
})
...
...
@@ -22,7 +22,7 @@ export async function coderCloudExpose(serverName: string): Promise<void> {
return
new
Promise
((
res
,
rej
)
=>
{
agent
.
on
(
"
error
"
,
rej
)
agent
.
on
(
"
close
"
,
code
=>
{
agent
.
on
(
"
close
"
,
(
code
)
=>
{
if
(
code
!==
0
)
{
rej
({
message
:
`coder cloud agent exited with
${
code
}
`
,
...
...
@@ -54,7 +54,7 @@ export function coderCloudProxy(addr: string) {
stdio
:
[
"
inherit
"
,
"
inherit
"
,
"
pipe
"
],
})
agent
.
stderr
.
pipe
(
split2
()).
on
(
"
data
"
,
line
=>
{
agent
.
stderr
.
pipe
(
split2
()).
on
(
"
data
"
,
(
line
)
=>
{
line
=
line
.
replace
(
/^
[
0-9-
]
+
[
0-9:
]
+
[^
]
+
\t
/
,
""
)
logger
.
info
(
line
)
})
...
...
@@ -62,7 +62,7 @@ export function coderCloudProxy(addr: string) {
return
new
Promise
((
res
,
rej
)
=>
{
agent
.
on
(
"
error
"
,
rej
)
agent
.
on
(
"
close
"
,
code
=>
{
agent
.
on
(
"
close
"
,
(
code
)
=>
{
if
(
code
!==
0
)
{
rej
({
message
:
`coder cloud agent exited with
${
code
}
`
,
...
...
@@ -77,7 +77,7 @@ export function coderCloudProxy(addr: string) {
const
proxy
=
async
()
=>
{
try
{
await
_proxy
()
}
catch
(
err
)
{
}
catch
(
err
)
{
logger
.
error
(
err
.
message
)
}
setTimeout
(
proxy
,
3000
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录