步骤:
1、获取 vs code 的 commit id,即vscode中关于这张图中的“提交”的这串很长的字符串
2、从 https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable 下载 vs code server,"${commit_id}"为第一步获取的字符串,可以直接在浏览器中下载
3、将 vscode-server-linux-x64.tar.gz 上传到 server,例如linux主机上
4、将下载的 vscode-server-linux-x64.tar.gz 解压到 ~/.vscode-server/bin/${commit_id} 目录下,不带 vscode-server-linux-x64 目录。
5、在 ~/.vscode-server/bin/${commit_id} 目录下创建一个文件,文件名为 0
命令行总结:
负责下载的机器,例如windows,或者linux:
commit_id=93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
# Download url is: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
curl -sSL "https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz
在需要安装vscode sever的机器上执行以下命令:
mkdir -p ~/.vscode-server/bin/${commit_id}
# assume that you upload vscode-server-linux-x64.tar.gz to /tmp dir
tar zxvf /tmp/vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/${commit_id} --strip 1
touch ~/.vscode-server/bin/${commit_id}/0