Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
811cf336
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
未验证
提交
811cf336
编写于
10月 09, 2020
作者:
A
Anmol Sethi
提交者:
GitHub
10月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
install.sh: Allow installing directly onto a remote host (#2183)
Updates #1729 To fully close that issue see the various TODOs.
上级
64a6a460
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
48 addition
and
4 deletion
+48
-4
install.sh
install.sh
+48
-4
未找到文件。
install.sh
浏览文件 @
811cf336
...
@@ -17,21 +17,28 @@ usage() {
...
@@ -17,21 +17,28 @@ usage() {
Installs code-server for Linux, macOS and FreeBSD.
Installs code-server for Linux, macOS and FreeBSD.
It tries to use the system package manager if possible.
It tries to use the system package manager if possible.
After successful installation it explains how to start using code-server.
After successful installation it explains how to start using code-server.
Pass in user@host to install code-server on user@host over ssh.
The remote host must have internet access.
${
not_curl_usage
-
}
${
not_curl_usage
-
}
Usage:
Usage:
$arg0
[--dry-run] [--version X.X.X] [--method detect] [--prefix ~/.local]
$arg0
[--dry-run] [--version X.X.X] [--method detect]
\
[--prefix ~/.local] [user@host]
--dry-run
--dry-run
Echo the commands for the install process without running them.
Echo the commands for the install process without running them.
--version X.X.X
--version X.X.X
Install a specific version instead of the latest.
Install a specific version instead of the latest.
--method [detect | standalone]
--method [detect | standalone]
Choose the installation method. Defaults to detect.
Choose the installation method. Defaults to detect.
- detect detects the system package manager and tries to use it.
- detect detects the system package manager and tries to use it.
Full reference on the process is further below.
Full reference on the process is further below.
- standalone installs a standalone release archive into ~/.local
- standalone installs a standalone release archive into ~/.local
Add ~/.local/bin to your
\$
PATH to use it.
Add ~/.local/bin to your
\$
PATH to use it.
--prefix <dir>
--prefix <dir>
Sets the prefix used by standalone release archives. Defaults to ~/.local
Sets the prefix used by standalone release archives. Defaults to ~/.local
The release is unarchived into ~/.local/lib/code-server-X.X.X
The release is unarchived into ~/.local/lib/code-server-X.X.X
...
@@ -100,9 +107,18 @@ main() {
...
@@ -100,9 +107,18 @@ main() {
METHOD
\
METHOD
\
STANDALONE_INSTALL_PREFIX
\
STANDALONE_INSTALL_PREFIX
\
VERSION
\
VERSION
\
OPTIONAL
OPTIONAL
\
ALL_FLAGS
\
SSH_ARGS
ALL_FLAGS
=
""
while
[
"$#"
-gt
0
]
;
do
while
[
"$#"
-gt
0
]
;
do
case
"
$1
"
in
-
*
)
ALL_FLAGS
=
"
${
ALL_FLAGS
}
$1
"
;;
esac
case
"
$1
"
in
case
"
$1
"
in
--dry-run
)
--dry-run
)
DRY_RUN
=
1
DRY_RUN
=
1
...
@@ -132,16 +148,33 @@ main() {
...
@@ -132,16 +148,33 @@ main() {
usage
usage
exit
0
exit
0
;;
;;
*
)
--
)
shift
# We remove the -- added above.
ALL_FLAGS
=
"
${
ALL_FLAGS
% --
}
"
SSH_ARGS
=
"
$*
"
break
;;
-
*
)
echoerr
"Unknown flag
$1
"
echoerr
"Unknown flag
$1
"
echoerr
"Run with --help to see usage."
echoerr
"Run with --help to see usage."
exit
1
exit
1
;;
;;
*
)
SSH_ARGS
=
"
$*
"
break
;;
esac
esac
shift
shift
done
done
if
[
"
${
SSH_ARGS
-
}
"
]
;
then
echoh
"Installing remotely with ssh
$SSH_ARGS
"
curl
-fsSL
https://code-server.dev/install.sh | prefix
"
$SSH_ARGS
"
ssh
"
$SSH_ARGS
"
sh
-s
--
"
$ALL_FLAGS
"
return
fi
VERSION
=
"
${
VERSION
-
$(
echo_latest_version
)
}
"
VERSION
=
"
${
VERSION
-
$(
echo_latest_version
)
}
"
METHOD
=
"
${
METHOD
-detect
}
"
METHOD
=
"
${
METHOD
-detect
}
"
if
[
"
$METHOD
"
!=
detect
]
&&
[
"
$METHOD
"
!=
standalone
]
;
then
if
[
"
$METHOD
"
!=
detect
]
&&
[
"
$METHOD
"
!=
standalone
]
;
then
...
@@ -446,7 +479,7 @@ arch() {
...
@@ -446,7 +479,7 @@ arch() {
}
}
command_exists
()
{
command_exists
()
{
command
-v
"
$@
"
>
/dev/null
2>&1
command
-v
"
$@
"
>
/dev/null
}
}
sh_c
()
{
sh_c
()
{
...
@@ -500,4 +533,15 @@ humanpath() {
...
@@ -500,4 +533,15 @@ humanpath() {
sed
"s#
$HOME
# ~#g; s#
\"
$HOME
#
\"\$
HOME#g"
sed
"s#
$HOME
# ~#g; s#
\"
$HOME
#
\"\$
HOME#g"
}
}
# We need to make sure we exit with a non zero exit if the command fails.
# /bin/sh does not support -o pipefail unfortunately.
prefix
()
{
PREFIX
=
"
$1
"
shift
fifo
=
"
$(
mktemp
-d
)
/fifo"
mkfifo
"
$fifo
"
sed
-e
"s#^#
$PREFIX
: #"
"
$fifo
"
&
"
$@
"
>
"
$fifo
"
2>&1
}
main
"
$@
"
main
"
$@
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录