vscode-offline 0.1.6__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vscode_offline-0.1.6/.github/workflows/publish.yml → vscode_offline-0.1.8/.github/workflows/build.yml +33 -2
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/.gitignore +3 -0
- vscode_offline-0.1.8/PKG-INFO +137 -0
- vscode_offline-0.1.8/README.md +114 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/pyproject.toml +4 -1
- vscode_offline-0.1.8/src/vscode_offline/__init__.py +9 -0
- vscode_offline-0.1.8/src/vscode_offline/_version.py +34 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/src/vscode_offline/app.py +48 -23
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/src/vscode_offline/download.py +33 -20
- vscode_offline-0.1.8/src/vscode_offline/py.typed +0 -0
- vscode_offline-0.1.8/src/vscode_offline/utils.py +265 -0
- vscode_offline-0.1.8/tests/test_utils.py +89 -0
- vscode_offline-0.1.6/.github/workflows/test.yml +0 -38
- vscode_offline-0.1.6/PKG-INFO +0 -83
- vscode_offline-0.1.6/README.md +0 -60
- vscode_offline-0.1.6/src/vscode_offline/__init__.py +0 -3
- vscode_offline-0.1.6/src/vscode_offline/utils.py +0 -131
- vscode_offline-0.1.6/tests/test_utils.py +0 -45
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/.editorconfig +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/.python-version +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/.vscode/extensions.json +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/.vscode/settings.json +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/LICENSE +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/lefthook.yml +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/pyrightconfig.json +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/src/vscode_offline/install.py +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/src/vscode_offline/loggers.py +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/tests/test_install.py +0 -0
- {vscode_offline-0.1.6 → vscode_offline-0.1.8}/uv.lock +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: Build
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
@@ -8,8 +8,39 @@ on:
|
|
8
8
|
- "v*"
|
9
9
|
|
10
10
|
jobs:
|
11
|
+
test:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- name: Checkout project
|
16
|
+
uses: actions/checkout@v5
|
17
|
+
with:
|
18
|
+
fetch-depth: 0 # Shallow clones should be disabled for a proper tag checkout
|
19
|
+
|
20
|
+
- name: Set up uv
|
21
|
+
uses: astral-sh/setup-uv@v6
|
22
|
+
with:
|
23
|
+
enable-cache: true
|
24
|
+
|
25
|
+
- name: Install dependencies
|
26
|
+
run: uv sync --locked
|
27
|
+
|
28
|
+
- name: Lint with ruff
|
29
|
+
run: uv run ruff check
|
30
|
+
|
31
|
+
- name: Type check with pyright
|
32
|
+
run: uv run pyright
|
33
|
+
|
34
|
+
- name: Format with ruff
|
35
|
+
run: uv run ruff format --check
|
36
|
+
|
37
|
+
- name: Run tests with pytest
|
38
|
+
run: uv run pytest tests
|
39
|
+
|
11
40
|
publish:
|
12
41
|
runs-on: ubuntu-latest
|
42
|
+
# This job depends on the successful completion of the 'test' job
|
43
|
+
needs: test
|
13
44
|
|
14
45
|
permissions:
|
15
46
|
contents: write # IMPORTANT: this permission is mandatory for uploading release assets
|
@@ -19,7 +50,7 @@ jobs:
|
|
19
50
|
- name: Checkout project
|
20
51
|
uses: actions/checkout@v5
|
21
52
|
with:
|
22
|
-
fetch-depth: 0
|
53
|
+
fetch-depth: 0 # Shallow clones should be disabled for a proper tag checkout
|
23
54
|
|
24
55
|
- name: Set up uv
|
25
56
|
uses: astral-sh/setup-uv@v6
|
@@ -0,0 +1,137 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: vscode-offline
|
3
|
+
Version: 0.1.8
|
4
|
+
Summary: Download and install VS Code for offline environments
|
5
|
+
Project-URL: Homepage, https://github.com/fanck0605/vscode-offline
|
6
|
+
Author-email: Chuck Fan <fanck0605@qq.com>
|
7
|
+
License-Expression: MIT
|
8
|
+
License-File: LICENSE
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
20
|
+
Classifier: Topic :: Utilities
|
21
|
+
Requires-Python: >=3.9
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
|
24
|
+
# vscode-offline
|
25
|
+
|
26
|
+
[](https://github.com/fanck0605/vscode-offline/actions/workflows/build.yml)
|
27
|
+
[](https://github.com/astral-sh/ruff)
|
28
|
+
[](https://pypi.org/project/vscode-offline/)
|
29
|
+
[](https://github.com/fanck0605/vscode-offline/blob/master/LICENSE)
|
30
|
+
|
31
|
+
**vscode-offline** 主要用于在无网环境下安装 VS Code 和 VS Code Server,方便使用 [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) 插件进行远程开发。
|
32
|
+
|
33
|
+
## 安装
|
34
|
+
|
35
|
+
```shell
|
36
|
+
pip install -U vscode-offline
|
37
|
+
```
|
38
|
+
|
39
|
+
## 优势
|
40
|
+
|
41
|
+
1. 自动识别并下载所有 `.vsix` 文件(包括间接依赖)
|
42
|
+
2. 一键安装 VS Code Server 以及其所有插件
|
43
|
+
|
44
|
+
## VS Code 离线安装
|
45
|
+
|
46
|
+
(1)在联网环境安装好 VS Code 和你需要的插件,如 [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh), [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) 等。
|
47
|
+
|
48
|
+
(2)执行如下命令,下载 VS Code 安装包,和目前安装的所有的插件
|
49
|
+
|
50
|
+
```shell
|
51
|
+
vscode-offline download-all --client-platform win32-x64 --server-platform linux-x64
|
52
|
+
```
|
53
|
+
|
54
|
+
(3)复制 `./vscode-offline-installer` 到内网 Windows 机器,安装 `./vscode-offline-installer/<version>` 下的 VS Code,然后执行如下命令安装所有插件
|
55
|
+
|
56
|
+
```shell
|
57
|
+
vscode-offline install-extensions --installer ./vscode-offline-installer
|
58
|
+
```
|
59
|
+
|
60
|
+
(4)复制 `./vscode-offline-installer` 到内网 Linux 服务器,执行如下命令安装 VS Code Server 和所有插件
|
61
|
+
|
62
|
+
```shell
|
63
|
+
vscode-offline install-server --installer ./vscode-offline-installer
|
64
|
+
```
|
65
|
+
|
66
|
+
## 指定 VS Code 版本号
|
67
|
+
|
68
|
+
如果你想下载或安装指定版本的 VS Code,可以先通过 `code --version` 获取当前版本,然后通过 --code-version 参数指定版本号,例如:
|
69
|
+
|
70
|
+
```shell
|
71
|
+
vscode-offline download-all --code-version 1.104.3
|
72
|
+
```
|
73
|
+
|
74
|
+
也支持使用 commit hash 作为版本号,例如:
|
75
|
+
|
76
|
+
```shell
|
77
|
+
vscode-offline download-all --code-version commit:385651c938df8a906869babee516bffd0ddb9829
|
78
|
+
```
|
79
|
+
|
80
|
+
|
81
|
+
## 文件下载地址
|
82
|
+
|
83
|
+
如果你不想使用 `vscode-offline`,也可以手动下载对应的文件。
|
84
|
+
|
85
|
+
VS Code / VS Code Server / VS Code CLI 下载地址格式:
|
86
|
+
|
87
|
+
```shell
|
88
|
+
curl -O https://update.code.visualstudio.com/<version>/<platform>/stable
|
89
|
+
curl -O https://update.code.visualstudio.com/commit:<commit>/<platform>/stable
|
90
|
+
|
91
|
+
# 比如
|
92
|
+
curl -O https://update.code.visualstudio.com/1.104.3/cli-alpine-x64/stable
|
93
|
+
curl -O https://update.code.visualstudio.com/commit:385651c938df8a906869babee516bffd0ddb9829/win32-x64/stable
|
94
|
+
```
|
95
|
+
|
96
|
+
|
97
|
+
VS Code Extension 下载地址格式:
|
98
|
+
|
99
|
+
```shell
|
100
|
+
curl -O https://marketplace.visualstudio.com/_apis/public/gallery/publishers/<publisher>/vsextensions/<extension>/<version>/vspackage?targetPlatform=<platform>
|
101
|
+
|
102
|
+
# 比如
|
103
|
+
curl -O https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2025.14.0/vspackage?targetPlatform=linux-x64
|
104
|
+
```
|
105
|
+
|
106
|
+
Platform 映射关系:
|
107
|
+
|
108
|
+
| VS Code | VS Code Server | VS Code CLI | VS Code Extension |
|
109
|
+
| ------------------- | ------------------- | ---------------- | ----------------- |
|
110
|
+
| win32-x64 | server-win32-x64 | cli-win32-x64 | win32-x64 |
|
111
|
+
| win32-x64-user | server-win32-x64 | cli-win32-x64 | win32-x64 |
|
112
|
+
| win32-x64-archive | server-win32-x64 | cli-win32-x64 | win32-x64 |
|
113
|
+
| win32-arm64 | server-win32-arm64 | cli-win32-arm64 | win32-arm64 |
|
114
|
+
| win32-arm64-user | server-win32-arm64 | cli-win32-arm64 | win32-arm64 |
|
115
|
+
| win32-arm64-archive | server-win32-arm64 | cli-win32-arm64 | win32-arm64 |
|
116
|
+
| linux-x64 | server-linux-x64 | cli-alpine-x64 | linux-x64 |
|
117
|
+
| linux-deb-x64 | server-linux-x64 | cli-alpine-x64 | linux-x64 |
|
118
|
+
| linux-rpm-x64 | server-linux-x64 | cli-alpine-x64 | linux-x64 |
|
119
|
+
| linux-arm64 | server-linux-arm64 | cli-alpine-arm64 | linux-arm64 |
|
120
|
+
| linux-deb-arm64 | server-linux-arm64 | cli-alpine-arm64 | linux-arm64 |
|
121
|
+
| linux-rpm-arm64 | server-linux-arm64 | cli-alpine-arm64 | linux-arm64 |
|
122
|
+
| linux-armhf | server-linux-armhf | cli-linux-armhf | linux-armhf |
|
123
|
+
| linux-deb-armhf | server-linux-armhf | cli-linux-armhf | linux-armhf |
|
124
|
+
| linux-rpm-armhf | server-linux-armhf | cli-linux-armhf | linux-armhf |
|
125
|
+
| darwin | server-darwin | cli-darwin-x64 | darwin-x64 |
|
126
|
+
| darwin-arm64 | server-darwin-arm64 | cli-darwin-arm64 | darwin-arm64 |
|
127
|
+
|
128
|
+
|
129
|
+
## 贡献
|
130
|
+
|
131
|
+
欢迎提交 Issue 和 PR 改进本项目。
|
132
|
+
|
133
|
+
## License
|
134
|
+
|
135
|
+
Copyright (c) 2025 Chuck Fan.
|
136
|
+
|
137
|
+
Distributed under the terms of the [MIT License](https://github.com/fanck0605/vscode-offline/blob/master/LICENSE).
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# vscode-offline
|
2
|
+
|
3
|
+
[](https://github.com/fanck0605/vscode-offline/actions/workflows/build.yml)
|
4
|
+
[](https://github.com/astral-sh/ruff)
|
5
|
+
[](https://pypi.org/project/vscode-offline/)
|
6
|
+
[](https://github.com/fanck0605/vscode-offline/blob/master/LICENSE)
|
7
|
+
|
8
|
+
**vscode-offline** 主要用于在无网环境下安装 VS Code 和 VS Code Server,方便使用 [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) 插件进行远程开发。
|
9
|
+
|
10
|
+
## 安装
|
11
|
+
|
12
|
+
```shell
|
13
|
+
pip install -U vscode-offline
|
14
|
+
```
|
15
|
+
|
16
|
+
## 优势
|
17
|
+
|
18
|
+
1. 自动识别并下载所有 `.vsix` 文件(包括间接依赖)
|
19
|
+
2. 一键安装 VS Code Server 以及其所有插件
|
20
|
+
|
21
|
+
## VS Code 离线安装
|
22
|
+
|
23
|
+
(1)在联网环境安装好 VS Code 和你需要的插件,如 [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh), [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) 等。
|
24
|
+
|
25
|
+
(2)执行如下命令,下载 VS Code 安装包,和目前安装的所有的插件
|
26
|
+
|
27
|
+
```shell
|
28
|
+
vscode-offline download-all --client-platform win32-x64 --server-platform linux-x64
|
29
|
+
```
|
30
|
+
|
31
|
+
(3)复制 `./vscode-offline-installer` 到内网 Windows 机器,安装 `./vscode-offline-installer/<version>` 下的 VS Code,然后执行如下命令安装所有插件
|
32
|
+
|
33
|
+
```shell
|
34
|
+
vscode-offline install-extensions --installer ./vscode-offline-installer
|
35
|
+
```
|
36
|
+
|
37
|
+
(4)复制 `./vscode-offline-installer` 到内网 Linux 服务器,执行如下命令安装 VS Code Server 和所有插件
|
38
|
+
|
39
|
+
```shell
|
40
|
+
vscode-offline install-server --installer ./vscode-offline-installer
|
41
|
+
```
|
42
|
+
|
43
|
+
## 指定 VS Code 版本号
|
44
|
+
|
45
|
+
如果你想下载或安装指定版本的 VS Code,可以先通过 `code --version` 获取当前版本,然后通过 --code-version 参数指定版本号,例如:
|
46
|
+
|
47
|
+
```shell
|
48
|
+
vscode-offline download-all --code-version 1.104.3
|
49
|
+
```
|
50
|
+
|
51
|
+
也支持使用 commit hash 作为版本号,例如:
|
52
|
+
|
53
|
+
```shell
|
54
|
+
vscode-offline download-all --code-version commit:385651c938df8a906869babee516bffd0ddb9829
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
## 文件下载地址
|
59
|
+
|
60
|
+
如果你不想使用 `vscode-offline`,也可以手动下载对应的文件。
|
61
|
+
|
62
|
+
VS Code / VS Code Server / VS Code CLI 下载地址格式:
|
63
|
+
|
64
|
+
```shell
|
65
|
+
curl -O https://update.code.visualstudio.com/<version>/<platform>/stable
|
66
|
+
curl -O https://update.code.visualstudio.com/commit:<commit>/<platform>/stable
|
67
|
+
|
68
|
+
# 比如
|
69
|
+
curl -O https://update.code.visualstudio.com/1.104.3/cli-alpine-x64/stable
|
70
|
+
curl -O https://update.code.visualstudio.com/commit:385651c938df8a906869babee516bffd0ddb9829/win32-x64/stable
|
71
|
+
```
|
72
|
+
|
73
|
+
|
74
|
+
VS Code Extension 下载地址格式:
|
75
|
+
|
76
|
+
```shell
|
77
|
+
curl -O https://marketplace.visualstudio.com/_apis/public/gallery/publishers/<publisher>/vsextensions/<extension>/<version>/vspackage?targetPlatform=<platform>
|
78
|
+
|
79
|
+
# 比如
|
80
|
+
curl -O https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2025.14.0/vspackage?targetPlatform=linux-x64
|
81
|
+
```
|
82
|
+
|
83
|
+
Platform 映射关系:
|
84
|
+
|
85
|
+
| VS Code | VS Code Server | VS Code CLI | VS Code Extension |
|
86
|
+
| ------------------- | ------------------- | ---------------- | ----------------- |
|
87
|
+
| win32-x64 | server-win32-x64 | cli-win32-x64 | win32-x64 |
|
88
|
+
| win32-x64-user | server-win32-x64 | cli-win32-x64 | win32-x64 |
|
89
|
+
| win32-x64-archive | server-win32-x64 | cli-win32-x64 | win32-x64 |
|
90
|
+
| win32-arm64 | server-win32-arm64 | cli-win32-arm64 | win32-arm64 |
|
91
|
+
| win32-arm64-user | server-win32-arm64 | cli-win32-arm64 | win32-arm64 |
|
92
|
+
| win32-arm64-archive | server-win32-arm64 | cli-win32-arm64 | win32-arm64 |
|
93
|
+
| linux-x64 | server-linux-x64 | cli-alpine-x64 | linux-x64 |
|
94
|
+
| linux-deb-x64 | server-linux-x64 | cli-alpine-x64 | linux-x64 |
|
95
|
+
| linux-rpm-x64 | server-linux-x64 | cli-alpine-x64 | linux-x64 |
|
96
|
+
| linux-arm64 | server-linux-arm64 | cli-alpine-arm64 | linux-arm64 |
|
97
|
+
| linux-deb-arm64 | server-linux-arm64 | cli-alpine-arm64 | linux-arm64 |
|
98
|
+
| linux-rpm-arm64 | server-linux-arm64 | cli-alpine-arm64 | linux-arm64 |
|
99
|
+
| linux-armhf | server-linux-armhf | cli-linux-armhf | linux-armhf |
|
100
|
+
| linux-deb-armhf | server-linux-armhf | cli-linux-armhf | linux-armhf |
|
101
|
+
| linux-rpm-armhf | server-linux-armhf | cli-linux-armhf | linux-armhf |
|
102
|
+
| darwin | server-darwin | cli-darwin-x64 | darwin-x64 |
|
103
|
+
| darwin-arm64 | server-darwin-arm64 | cli-darwin-arm64 | darwin-arm64 |
|
104
|
+
|
105
|
+
|
106
|
+
## 贡献
|
107
|
+
|
108
|
+
欢迎提交 Issue 和 PR 改进本项目。
|
109
|
+
|
110
|
+
## License
|
111
|
+
|
112
|
+
Copyright (c) 2025 Chuck Fan.
|
113
|
+
|
114
|
+
Distributed under the terms of the [MIT License](https://github.com/fanck0605/vscode-offline/blob/master/LICENSE).
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
5
5
|
[project]
|
6
6
|
name = "vscode-offline"
|
7
7
|
dynamic = ["version"]
|
8
|
-
description = "Download and install VS Code
|
8
|
+
description = "Download and install VS Code for offline environments"
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [{ name = "Chuck Fan", email = "fanck0605@qq.com" }]
|
11
11
|
requires-python = ">=3.9"
|
@@ -45,6 +45,9 @@ dev = [
|
|
45
45
|
[tool.hatch.version]
|
46
46
|
source = "vcs"
|
47
47
|
|
48
|
+
[tool.hatch.build.hooks.vcs]
|
49
|
+
version-file = "src/vscode_offline/_version.py"
|
50
|
+
|
48
51
|
[tool.ruff.lint]
|
49
52
|
select = [
|
50
53
|
"ANN", # flake8-annotations
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# file generated by setuptools-scm
|
2
|
+
# don't change, don't track in version control
|
3
|
+
|
4
|
+
__all__ = [
|
5
|
+
"__version__",
|
6
|
+
"__version_tuple__",
|
7
|
+
"version",
|
8
|
+
"version_tuple",
|
9
|
+
"__commit_id__",
|
10
|
+
"commit_id",
|
11
|
+
]
|
12
|
+
|
13
|
+
TYPE_CHECKING = False
|
14
|
+
if TYPE_CHECKING:
|
15
|
+
from typing import Tuple
|
16
|
+
from typing import Union
|
17
|
+
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
19
|
+
COMMIT_ID = Union[str, None]
|
20
|
+
else:
|
21
|
+
VERSION_TUPLE = object
|
22
|
+
COMMIT_ID = object
|
23
|
+
|
24
|
+
version: str
|
25
|
+
__version__: str
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
27
|
+
version_tuple: VERSION_TUPLE
|
28
|
+
commit_id: COMMIT_ID
|
29
|
+
__commit_id__: COMMIT_ID
|
30
|
+
|
31
|
+
__version__ = version = '0.1.8'
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 8)
|
33
|
+
|
34
|
+
__commit_id__ = commit_id = None
|
@@ -4,6 +4,7 @@ import logging
|
|
4
4
|
from argparse import ArgumentParser, Namespace
|
5
5
|
from pathlib import Path
|
6
6
|
|
7
|
+
from vscode_offline._version import __version__
|
7
8
|
from vscode_offline.download import (
|
8
9
|
download_vscode_client,
|
9
10
|
download_vscode_extensions,
|
@@ -15,10 +16,14 @@ from vscode_offline.install import (
|
|
15
16
|
install_vscode_server,
|
16
17
|
)
|
17
18
|
from vscode_offline.utils import (
|
19
|
+
get_client_platform,
|
18
20
|
get_default_code_version,
|
21
|
+
get_extension_platform,
|
19
22
|
get_host_platform,
|
23
|
+
get_server_platform,
|
20
24
|
get_vscode_extensions_config,
|
21
25
|
get_vscode_version_from_server_installer,
|
26
|
+
validate_platform,
|
22
27
|
)
|
23
28
|
|
24
29
|
|
@@ -32,13 +37,15 @@ def cmd_download_server(args: Namespace) -> None:
|
|
32
37
|
|
33
38
|
download_vscode_server(
|
34
39
|
args.code_version,
|
35
|
-
output=args.installer /
|
36
|
-
platform=args.platform,
|
40
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
41
|
+
platform=get_server_platform(args.platform),
|
37
42
|
)
|
38
43
|
extensions_config = Path(args.extensions_config).expanduser()
|
39
44
|
download_vscode_extensions(
|
40
45
|
extensions_config,
|
41
|
-
target_platforms=
|
46
|
+
target_platforms={
|
47
|
+
get_extension_platform(args.platform),
|
48
|
+
},
|
42
49
|
output=args.installer / "extensions",
|
43
50
|
)
|
44
51
|
|
@@ -56,13 +63,13 @@ def cmd_install_server(args: Namespace) -> None:
|
|
56
63
|
) from None
|
57
64
|
|
58
65
|
vscode_server_home = install_vscode_server(
|
59
|
-
server_installer=args.installer /
|
60
|
-
platform=host_platform,
|
66
|
+
server_installer=args.installer / args.code_version.replace(":", "-"),
|
67
|
+
platform=get_server_platform(host_platform),
|
61
68
|
)
|
62
69
|
install_vscode_extensions(
|
63
70
|
Path(vscode_server_home) / "bin/code-server",
|
64
71
|
vsix_dir=args.installer / "extensions",
|
65
|
-
platform=host_platform,
|
72
|
+
platform=get_extension_platform(host_platform),
|
66
73
|
exclude=SERVER_EXCLUDE_EXTENSIONS,
|
67
74
|
)
|
68
75
|
|
@@ -71,7 +78,9 @@ def cmd_download_extensions(args: Namespace) -> None:
|
|
71
78
|
extensions_config = Path(args.extensions_config).expanduser()
|
72
79
|
download_vscode_extensions(
|
73
80
|
extensions_config,
|
74
|
-
target_platforms=
|
81
|
+
target_platforms={
|
82
|
+
get_extension_platform(args.platform),
|
83
|
+
},
|
75
84
|
output=args.installer / "extensions",
|
76
85
|
)
|
77
86
|
|
@@ -81,7 +90,7 @@ def cmd_install_extensions(args: Namespace) -> None:
|
|
81
90
|
install_vscode_extensions(
|
82
91
|
args.code,
|
83
92
|
vsix_dir=args.installer / "extensions",
|
84
|
-
platform=host_platform,
|
93
|
+
platform=get_extension_platform(host_platform),
|
85
94
|
)
|
86
95
|
|
87
96
|
|
@@ -95,13 +104,15 @@ def cmd_download_client(args: Namespace) -> None:
|
|
95
104
|
|
96
105
|
download_vscode_client(
|
97
106
|
args.code_version,
|
98
|
-
output=args.installer /
|
99
|
-
platform=args.platform,
|
107
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
108
|
+
platform=get_client_platform(args.platform),
|
100
109
|
)
|
101
110
|
extensions_config = Path(args.extensions_config).expanduser()
|
102
111
|
download_vscode_extensions(
|
103
112
|
extensions_config,
|
104
|
-
target_platforms=
|
113
|
+
target_platforms={
|
114
|
+
get_extension_platform(args.platform),
|
115
|
+
},
|
105
116
|
output=args.installer / "extensions",
|
106
117
|
)
|
107
118
|
|
@@ -116,22 +127,30 @@ def cmd_download_all(args: Namespace) -> None:
|
|
116
127
|
|
117
128
|
download_vscode_server(
|
118
129
|
args.code_version,
|
119
|
-
output=args.installer /
|
120
|
-
platform=args.server_platform,
|
130
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
131
|
+
platform=get_server_platform(args.server_platform),
|
121
132
|
)
|
122
133
|
download_vscode_client(
|
123
134
|
args.code_version,
|
124
|
-
output=args.installer /
|
125
|
-
platform=args.client_platform,
|
135
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
136
|
+
platform=get_client_platform(args.client_platform),
|
126
137
|
)
|
127
138
|
extensions_config = Path(args.extensions_config).expanduser()
|
128
139
|
download_vscode_extensions(
|
129
140
|
extensions_config,
|
130
|
-
target_platforms=
|
141
|
+
target_platforms={
|
142
|
+
get_extension_platform(args.server_platform),
|
143
|
+
get_extension_platform(args.client_platform),
|
144
|
+
},
|
131
145
|
output=args.installer / "extensions",
|
132
146
|
)
|
133
147
|
|
134
148
|
|
149
|
+
def cmd_version(args: Namespace) -> None:
|
150
|
+
# print version instead of logging
|
151
|
+
print(__version__)
|
152
|
+
|
153
|
+
|
135
154
|
def make_argparser() -> ArgumentParser:
|
136
155
|
parent_parser = ArgumentParser(add_help=False)
|
137
156
|
|
@@ -145,6 +164,12 @@ def make_argparser() -> ArgumentParser:
|
|
145
164
|
parser = ArgumentParser()
|
146
165
|
subparsers = parser.add_subparsers(required=True)
|
147
166
|
|
167
|
+
version_parser = subparsers.add_parser(
|
168
|
+
"version",
|
169
|
+
help="Show version information",
|
170
|
+
)
|
171
|
+
version_parser.set_defaults(func=cmd_version)
|
172
|
+
|
148
173
|
download_server_parser = subparsers.add_parser(
|
149
174
|
"download-server",
|
150
175
|
help="Download VS Code Server and extensions",
|
@@ -158,7 +183,7 @@ def make_argparser() -> ArgumentParser:
|
|
158
183
|
)
|
159
184
|
download_server_parser.add_argument(
|
160
185
|
"--platform",
|
161
|
-
type=
|
186
|
+
type=validate_platform,
|
162
187
|
required=True,
|
163
188
|
help="The target platform of the VS Code Server to download.",
|
164
189
|
)
|
@@ -189,7 +214,7 @@ def make_argparser() -> ArgumentParser:
|
|
189
214
|
download_extensions_parser.set_defaults(func=cmd_download_extensions)
|
190
215
|
download_extensions_parser.add_argument(
|
191
216
|
"--platform",
|
192
|
-
type=
|
217
|
+
type=validate_platform,
|
193
218
|
required=True,
|
194
219
|
help="The target platform of the VS Code extensions to download.",
|
195
220
|
)
|
@@ -226,7 +251,7 @@ def make_argparser() -> ArgumentParser:
|
|
226
251
|
)
|
227
252
|
download_client_parser.add_argument(
|
228
253
|
"--platform",
|
229
|
-
type=
|
254
|
+
type=validate_platform,
|
230
255
|
required=True,
|
231
256
|
help="The target platform of the VS Code to download.",
|
232
257
|
)
|
@@ -250,14 +275,14 @@ def make_argparser() -> ArgumentParser:
|
|
250
275
|
)
|
251
276
|
download_all_parser.add_argument(
|
252
277
|
"--server-platform",
|
253
|
-
type=
|
254
|
-
|
278
|
+
type=validate_platform,
|
279
|
+
required=True,
|
255
280
|
help="The target platform of the VS Code Server to download, defaults to linux-x64.",
|
256
281
|
)
|
257
282
|
download_all_parser.add_argument(
|
258
283
|
"--client-platform",
|
259
|
-
type=
|
260
|
-
|
284
|
+
type=validate_platform,
|
285
|
+
required=True,
|
261
286
|
help="The target platform of the VS Code to download, defaults to win32-x64.",
|
262
287
|
)
|
263
288
|
download_all_parser.add_argument(
|