@lazycatcloud/lzc-cli 1.3.13 → 1.3.15
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.
- package/changelog.md +19 -0
- package/lib/app/lpk_build.js +14 -10
- package/lib/app/lpk_create.js +3 -2
- package/lib/app/lpk_create_generator.js +6 -3
- package/lib/app/lpk_devshell.js +2 -2
- package/lib/app/lpk_installer.js +7 -6
- package/lib/appstore/index.js +56 -16
- package/lib/appstore/publish.js +16 -13
- package/lib/box/index.js +2 -2
- package/lib/config/index.js +3 -2
- package/lib/debug_bridge.js +17 -15
- package/lib/i18n/index.js +1 -0
- package/lib/i18n/locales/en/translation.json +250 -249
- package/lib/i18n/locales/zh/translation.json +42 -41
- package/lib/shellapi.js +5 -5
- package/lib/utils.js +14 -11
- package/package.json +4 -3
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"lpk_build": {
|
|
36
36
|
"archive_folder_to_exist_fail": "{{appDir}} 文件夹不存在",
|
|
37
|
-
"exec_ai_pos_service_not_exist": "{{aiPodService}} 不存在",
|
|
38
|
-
"exec_browser_extension_not_exist": "{{browserExtension}} 不存在",
|
|
37
|
+
"exec_ai_pos_service_not_exist": "{{ aiPodService }} 不存在",
|
|
38
|
+
"exec_browser_extension_not_exist": "{{ browserExtension }} 不存在",
|
|
39
39
|
"exec_build_fail": "构建失败",
|
|
40
|
-
"exec_output_lpk_path": "输出lpk包 {{
|
|
41
|
-
"exec_pkgout_not_exist": "{{pkgout}} 不存在",
|
|
40
|
+
"exec_output_lpk_path": "输出lpk包 {{ path }}",
|
|
41
|
+
"exec_pkgout_not_exist": "{{ pkgout }} 不存在",
|
|
42
42
|
"exec_skip_buildscript": "跳过执行 buildscript",
|
|
43
43
|
"exec_skip_copy_contentdir": "跳过拷贝 contentdir 内容",
|
|
44
44
|
"fetch_icon_to_icon_empty_fail": "图标icon 没有指定",
|
|
45
45
|
"fetch_icon_to_icon_extname_fail": "图标icon 不是一个 .png 文件",
|
|
46
|
-
"fetch_icon_to_icon_file_not_exist_fail": "图标icon {{iconPath}} 不存在",
|
|
47
|
-
"fetch_icon_to_icon_is_png": "图标icon {{iconPath}} 验证成功(png格式)",
|
|
48
|
-
"fetch_icon_to_icon_not_is_png_fail": "图标icon {{iconPath}} 验证失败(不是一个png格式)",
|
|
46
|
+
"fetch_icon_to_icon_file_not_exist_fail": "图标icon {{ iconPath }} 不存在",
|
|
47
|
+
"fetch_icon_to_icon_is_png": "图标icon {{ iconPath }} 验证成功(png格式)",
|
|
48
|
+
"fetch_icon_to_icon_not_is_png_fail": "图标icon {{ iconPath }} 验证失败(不是一个png格式)",
|
|
49
49
|
"fetch_lzc_deploy_param_to_exist": "检测当前目录下具有 lzc-deploy-params.yml",
|
|
50
|
-
"fetch_lzc_deploy_param_to_not_exist": "deploy_params {{deployParamsPath}} 不存在",
|
|
51
|
-
"get_manifest_package_name_fail": "{{package}} 含有非法字符,请使用正确的包名格式(java的包名格式),如:cloud.lazycat.apps.video",
|
|
50
|
+
"fetch_lzc_deploy_param_to_not_exist": "deploy_params {{ deployParamsPath }} 不存在",
|
|
51
|
+
"get_manifest_package_name_fail": "{{ package }} 含有非法字符,请使用正确的包名格式(java的包名格式),如:cloud.lazycat.apps.video",
|
|
52
52
|
"get_manifest_subdomain_empty": "application 模块下的 subdomain 字段不能为空",
|
|
53
53
|
"local_ip_is_windows_fail": "当前 Windows 不支持使用 LocalIP 反代"
|
|
54
54
|
},
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
"ask_lpk_info_message": "请输入应用ID,例如 app-demo1",
|
|
57
57
|
"ask_lpk_info_validate_fail": "允许小写字母或数字或-的组合,但不以数字开头,且不能以 - 开头或结束,也不能有连续的短横线 --",
|
|
58
58
|
"choose_template_message": "选择项目构建模板",
|
|
59
|
-
"exec_init_project_name_exist_tips": "! 检测到相同目录,已自动将旧目录重命名为 {{renamedFileName}}",
|
|
59
|
+
"exec_init_project_name_exist_tips": "! 检测到相同目录,已自动将旧目录重命名为 {{ renamedFileName }}",
|
|
60
60
|
"exec_init_project_success_tips": "✨ 初始化懒猫云应用",
|
|
61
|
-
"exec_init_project_tips": "✨ 初始化项目 {{name}}"
|
|
61
|
+
"exec_init_project_tips": "✨ 初始化项目 {{ name }}"
|
|
62
62
|
},
|
|
63
63
|
"lpk_create_generator": {
|
|
64
|
-
"app_create_success_tip": "\n✨ 懒猫微服应用已创建成功 !\n✨ 进行下面步骤后即可进入容器开发\n cd {{name}}\n lzc-cli project devshell\n ",
|
|
64
|
+
"app_create_success_tip": "\n✨ 懒猫微服应用已创建成功 !\n✨ 进行下面步骤后即可进入容器开发\n cd {{ name }}\n lzc-cli project devshell\n ",
|
|
65
65
|
"template_config_vue3_green": "\n⚙️ 进入应用容器后执行下面命令:\n npm install\n npm run dev\n🚀 启动应用:\n 进入微服客户端启动器页面点击应用图标来测试应用\n ",
|
|
66
|
-
"write_file_tree_create_file": "创建文件 {{filePath}}"
|
|
66
|
+
"write_file_tree_create_file": "创建文件 {{ filePath }}"
|
|
67
67
|
},
|
|
68
68
|
"lpk_devshell": {
|
|
69
69
|
"devshell_build_dockerfile_tips": "开始创建 Dockerfile 文件",
|
|
70
70
|
"devshell_build_field_fail": "devshell 模式下,devshell 字段必须要指定",
|
|
71
|
-
"devshell_build_image_for_box_tips": "开始在盒子中构建 {{label}} 镜像 from {{tempDir}}",
|
|
72
|
-
"devshell_build_label_image_box_tips": "开始在盒子中构建 {{label}} 镜像",
|
|
71
|
+
"devshell_build_image_for_box_tips": "开始在盒子中构建 {{ label }} 镜像 from {{ tempDir }}",
|
|
72
|
+
"devshell_build_label_image_box_tips": "开始在盒子中构建 {{ label }} 镜像",
|
|
73
73
|
"devshell_build_routes_not_exists_fail": "devshell 模式下,必须要指定 routes 内容",
|
|
74
74
|
"devshell_build_skip_dependencies_tips": "dependencies 内容为空,跳过 dependencies",
|
|
75
75
|
"sync_project_code_tips": "同步代码: ",
|
|
@@ -83,15 +83,15 @@
|
|
|
83
83
|
"deploy_start_tips": "开始部署应用",
|
|
84
84
|
"install_form_url_download_lpk_done_tips": "下载完成",
|
|
85
85
|
"install_form_url_download_lpk_tips": "开始下载lpk",
|
|
86
|
-
"install_from_dir_scan_tips": "正在安装自动扫描出来的lpk包({{lpk}})",
|
|
87
|
-
"install_from_file_done_tips": "👉 请在浏览器中访问 https://{{subdomain}}.{{boxname}}.heiyu.space",
|
|
88
|
-
"install_from_file_fail_tips": "安装失败: {{error}}",
|
|
86
|
+
"install_from_dir_scan_tips": "正在安装自动扫描出来的lpk包({{ lpk }})",
|
|
87
|
+
"install_from_file_done_tips": "👉 请在浏览器中访问 https://{{ subdomain }}.{{ boxname }}.heiyu.space",
|
|
88
|
+
"install_from_file_fail_tips": "安装失败: {{ error }}",
|
|
89
89
|
"install_from_file_gen_apk_error": "生成 APK 失败: ",
|
|
90
90
|
"install_from_file_gen_apk_error_tips": "生成 APK 失败,使用 lzc-cli project devshell --apk n 忽略该错误",
|
|
91
91
|
"install_from_file_gen_apk_tips": "是否生成APK:",
|
|
92
92
|
"install_from_file_login_tips": "👉 并使用微服的用户名和密码登录",
|
|
93
93
|
"install_from_file_lpk_path_fail": "install 必须指定一个 pkg 路径",
|
|
94
|
-
"install_from_file_lpk_path_not_exists_fail": "{{pkgPath}} 不存在",
|
|
94
|
+
"install_from_file_lpk_path_not_exists_fail": "{{ pkgPath }} 不存在",
|
|
95
95
|
"install_from_file_manifest_not_exists_app_subdomain_fail": "manifest.yml 中的 `application.subdomain` 字段不能为空",
|
|
96
96
|
"install_from_file_start_tips": "开始安装应用",
|
|
97
97
|
"install_from_file_success_tips": "安装成功!"
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"pre_publish_cmd_gid_desc": "内测组ID",
|
|
110
110
|
"publish_cmd_changelog_desc": "更新日志",
|
|
111
111
|
"publish_cmd_changelog_file_desc": "更新日志文件",
|
|
112
|
+
"publish_cmd_changelog_files_desc": "更新日志本地化语言文件 lang:path 例如 en:changelog.en.md",
|
|
112
113
|
"publish_cmd_changelog_lang_desc": "更新日志语言标识,默认通过当前 shell 语言环境识别",
|
|
113
114
|
"publish_cmd_desc": "发布到商店"
|
|
114
115
|
},
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
},
|
|
119
120
|
"box": {
|
|
120
121
|
"index": {
|
|
121
|
-
"add_public_key_cmd_apply_tips": "请点击下面的连接,或者复制到浏览器中打开,点击申请完成添加\n-> https://dev.{{boxname}}.heiyu.space/auth?key={{pk}}\n",
|
|
122
|
+
"add_public_key_cmd_apply_tips": "请点击下面的连接,或者复制到浏览器中打开,点击申请完成添加\n-> https://dev.{{ boxname }}.heiyu.space/auth?key={{ pk }}\n",
|
|
122
123
|
"add_public_key_cmd_desc": "添加public-key到开发者工具中",
|
|
123
124
|
"box_cmd_desc": "盒子管理",
|
|
124
125
|
"default_cmd_desc": "输出当前默认的盒子名",
|
|
@@ -140,11 +141,11 @@
|
|
|
140
141
|
"config_cmd_item_tips": "获取key为foo的配置",
|
|
141
142
|
"config_cmd_list_tips": "列出所有配置",
|
|
142
143
|
"del_cmd_desc": "删除配置",
|
|
143
|
-
"del_cmd_success": "删除 {{key}} 成功!",
|
|
144
|
+
"del_cmd_success": "删除 {{ key }} 成功!",
|
|
144
145
|
"get_cmd_desc": "获取配置",
|
|
145
146
|
"set_cmd_desc": "设置配置",
|
|
146
147
|
"set_cmd_key_or_value_is_empty_fail": "key 和 value 不能为空",
|
|
147
|
-
"set_cmd_success_tips": "{{key}} 配置成功!"
|
|
148
|
+
"set_cmd_success_tips": "{{ key }} 配置成功!"
|
|
148
149
|
}
|
|
149
150
|
},
|
|
150
151
|
"debug_bridge": {
|
|
@@ -152,11 +153,11 @@
|
|
|
152
153
|
"build_image_fail": "在微服中构建 image 失败",
|
|
153
154
|
"can_public_key_resolve_fail": "域名解析失败,请检查代理软件是否对 *.heiyu.space 拦截",
|
|
154
155
|
"check_dev_tools_fail_tips": "检测懒猫开发者工具失败,请检测您当前的网络或者懒猫微服客户端是否正常启动。",
|
|
155
|
-
"check_dev_tools_not_exist_tips": "检测到你还没有安装 '懒猫开发者工具',请先到商店中搜索安装\n点击直接跳转 https://appstore.{{boxname}}.heiyu.space/#/shop/detail/cloud.lazycat.developer.tools\n点击打开应用 https://dev.{{boxname}}.heiyu.space 查看应用状态\n",
|
|
156
|
-
"common_exec_fail": "执行命令 {{cmd}} {{args}} 出错\n{{stdout}}\n{{stderr}}",
|
|
157
|
-
"common_start_log": "执行命令 {{cmd}} {{args}}",
|
|
156
|
+
"check_dev_tools_not_exist_tips": "检测到你还没有安装 '懒猫开发者工具',请先到商店中搜索安装\n点击直接跳转 https://appstore.{{ boxname }}.heiyu.space/#/shop/detail/cloud.lazycat.developer.tools\n点击打开应用 https://dev.{{ boxname }}.heiyu.space 查看应用状态\n",
|
|
157
|
+
"common_exec_fail": "执行命令 {{ cmd }} {{ args }} 出错\n{{ stdout }}\n{{ stderr }}",
|
|
158
|
+
"common_start_log": "执行命令 {{ cmd }} {{ args }}",
|
|
158
159
|
"install_fail": "install 失败",
|
|
159
|
-
"ssh_apply_grant_not_credible_tips": "您当前机器的公钥未添加到微服({{boxname}})的信任列表中,请使用微服管理员账号在浏览器中访问以下地址,将您选择的公钥自动添加到信任列表中。(所有操作均只在您微服中进行,包括本开发机在内的任何数据不会泄漏到您的微服之外)\n\n-> https://{{domain}}/auth?key={{pk}}\n",
|
|
160
|
+
"ssh_apply_grant_not_credible_tips": "您当前机器的公钥未添加到微服({{ boxname }})的信任列表中,请使用微服管理员账号在浏览器中访问以下地址,将您选择的公钥自动添加到信任列表中。(所有操作均只在您微服中进行,包括本开发机在内的任何数据不会泄漏到您的微服之外)\n\n-> https://{{ domain }}/auth?key={{ pk }}\n",
|
|
160
161
|
"ssh_apply_grant_not_exist_tips": "检测到您当前的环境还没有添加 ssh 公钥到 ‘懒猫开发者工具’ 中,请选择您需要添加的公钥类型"
|
|
161
162
|
},
|
|
162
163
|
"docker": {
|
|
@@ -184,7 +185,7 @@
|
|
|
184
185
|
"publish_pending_tips": "正在提交内测..."
|
|
185
186
|
},
|
|
186
187
|
"publish": {
|
|
187
|
-
"ask_changelog_prompt": "填写 changelog 内容 ({{locale}})",
|
|
188
|
+
"ask_changelog_prompt": "填写 changelog 内容 ({{ locale }})",
|
|
188
189
|
"ask_publish_app_info_author_prompt": "请输入作者名称(原创应用可不填):",
|
|
189
190
|
"ask_publish_app_info_name_prompt": "请输入应用名称:",
|
|
190
191
|
"ask_publish_app_info_name_validate": "应用名称不能为空",
|
|
@@ -193,18 +194,18 @@
|
|
|
193
194
|
"ask_publish_app_info_source_prompt": "请输入应用来源(原创应用可不填):",
|
|
194
195
|
"ask_whether_create_lpk_continue_prompt": "检测到您当前的应用,还没有在懒猫微服中创建,是否使用当前的安装包中的信息进行创建? [y/n]",
|
|
195
196
|
"ask_whether_create_lpk_fail_tips": "当前想发布的应用没有在 '懒猫微服的开发者中心' 创建,请按照以下步骤创建:\n\n1. 浏览器打开 https://developer.lazycat.cloud/manage\n2. 登录您的开发者帐号\n3. 登录成功后,您可以查看到您帐号中的应用,同时您也可以对您的应用进行管理\n4. 点击 '新增',根据您的应用信息进行填写\n5. 填写完成后,点击创建即可\n6. 创建成功后,您可以通过 'lzc-cli appstore publish' 来发布应用了\n",
|
|
196
|
-
"ask_whether_create_lpk_success_tips": "创建 {{package}} 应用成功!",
|
|
197
|
+
"ask_whether_create_lpk_success_tips": "创建 {{ package }} 应用成功!",
|
|
197
198
|
"check_app_id_exist_fail_tips": "检测应用是否存在出错, 错误状态码为: ",
|
|
198
199
|
"pre_check_fail_tips": "不能发布一个devshell的版本,请重新使用 `lzc-cli project build` 构建",
|
|
199
200
|
"pre_check_icon_not_exist_tips": "icon 必须存在且要求是 png 格式",
|
|
200
201
|
"publish_done_tips": "应用提交成功! 请等待审核结果",
|
|
201
202
|
"publish_fail_tips": "发布应用出错,错误状态码为: ",
|
|
202
|
-
"publish_lpk_fail_tips": "LPK 文件上传失败,err: {{message}}",
|
|
203
|
+
"publish_lpk_fail_tips": "LPK 文件上传失败,err: {{ message }}",
|
|
203
204
|
"publish_pending_tips": "正在提交审核..."
|
|
204
205
|
},
|
|
205
206
|
"shellapi": {
|
|
206
207
|
"init": {
|
|
207
|
-
"conf_file_not_exist_warn": "WARN:: 读取不到以下路径中的文件,无法连接客户端自动判读盒子名称和盒子用户,\n\n{{addrFile}} 盒子的连接地址\n{{credFile}} 盒子的连接凭证\n\n但可使用环境变量指定:\n - BOX_NAME=foo 指定盒子的名称\n - BOX_UID=bar 指定盒子的用户\n\nNOTE:在指定环境变量的模式下,有些接口依旧不能访问,为了更好的开发体验,建议尽量在同主机的环境下启动客户端",
|
|
208
|
+
"conf_file_not_exist_warn": "WARN:: 读取不到以下路径中的文件,无法连接客户端自动判读盒子名称和盒子用户,\n\n{{ addrFile }} 盒子的连接地址\n{{ credFile }} 盒子的连接凭证\n\n但可使用环境变量指定:\n - BOX_NAME=foo 指定盒子的名称\n - BOX_UID=bar 指定盒子的用户\n\nNOTE:在指定环境变量的模式下,有些接口依旧不能访问,为了更好的开发体验,建议尽量在同主机的环境下启动客户端",
|
|
208
209
|
"proxy_env_warn": "WARN:: 当前终端环境已配置 HTTP_PROXY 代理,可能会导致访问懒猫微服失败,如果未影响功能可以忽略该警告"
|
|
209
210
|
},
|
|
210
211
|
"init_box_info": {
|
|
@@ -212,28 +213,28 @@
|
|
|
212
213
|
"boxes_list_fail": "获取盒子信息失败,请检查客户端是否已经连接!"
|
|
213
214
|
},
|
|
214
215
|
"set_default_box": {
|
|
215
|
-
"box_not_exists_fail": "{{boxname}} 盒子不存在"
|
|
216
|
+
"box_not_exists_fail": "{{ boxname }} 盒子不存在"
|
|
216
217
|
}
|
|
217
218
|
},
|
|
218
219
|
"utils": {
|
|
219
|
-
"check_nodejs_version_no_match_tips": "检测到您当前的 nodejs 版本 {{version}} 不匹配,lzc-cli 最低要求 nodejs 版本为 {{requiredVersion}}, 请升级",
|
|
220
|
+
"check_nodejs_version_no_match_tips": "检测到您当前的 nodejs 版本 {{ version }} 不匹配,lzc-cli 最低要求 nodejs 版本为 {{ requiredVersion }}, 请升级",
|
|
220
221
|
"check_rsync_exec_version_log": "执行命令 rsync --version",
|
|
221
222
|
"check_rsync_not_install_fail": "请检查 rsync 是否安装,路径是否正确!",
|
|
222
223
|
"check_rsync_version_fail": "请检查 rsync 安装是否正确,指定 rsync --version 错误",
|
|
223
|
-
"check_rsync_version_no_match_fail": "当前 rsync 版本为:{{versionMatch}}, 要求 rsync 版本为: 3.2.0+",
|
|
224
|
-
"check_rsync_version_print_log": "当前 rsync 版本为:{{versionMatch}}",
|
|
225
|
-
"ensure_directory_exists_fail": "创建文件夹{{filePath}}错误: {{err}}",
|
|
224
|
+
"check_rsync_version_no_match_fail": "当前 rsync 版本为:{{ versionMatch }}, 要求 rsync 版本为: 3.2.0+",
|
|
225
|
+
"check_rsync_version_print_log": "当前 rsync 版本为:{{ versionMatch }}",
|
|
226
|
+
"ensure_directory_exists_fail": "创建文件夹{{ filePath }}错误: {{ err }}",
|
|
226
227
|
"find_ssh_public_key_dir_info_get_fail": "不能查询 .ssh 目录",
|
|
227
228
|
"find_ssh_public_key_dir_not_exist_fail": ".ssh 目录不存在, 请确保 ssh 已经安装,以及 ssh-keygen 生成公钥",
|
|
228
229
|
"find_ssh_public_key_files_not_exits_fail": ".ssh 目录没有没有找到任何 .pub 公钥. 请使用 ssh-keygen 生成",
|
|
229
230
|
"find_ssh_public_key_not_is_dir_fail": ".ssh 目前存在,但不是一个正常的目录,请确保 ssh 已经安装,以及 ssh-keygen 生成公钥",
|
|
230
|
-
"get_latest_version_fail_tips": "请求 {{url}} 失败, error: {{err}}",
|
|
231
|
-
"get_latest_version_success_tips": "已经在最新版本: {{latestVersion}}",
|
|
232
|
-
"get_latest_version_tips": "检测到 {{pkgName}} 最新版本为 {{latestVersion}},使用 'npm i -g {{pkgName}}@{{latestVersion}}' 升级到最新版本!",
|
|
233
|
-
"resolve_domain_fail_tips": "无法解析域名 {{domain}}: ",
|
|
231
|
+
"get_latest_version_fail_tips": "请求 {{ url }} 失败, error: {{ err }}",
|
|
232
|
+
"get_latest_version_success_tips": "已经在最新版本: {{ latestVersion }}",
|
|
233
|
+
"get_latest_version_tips": "检测到 {{ pkgName }} 最新版本为 {{ latestVersion }},使用 'npm i -g {{ pkgName }}@{{ latestVersion }}' 升级到最新版本!",
|
|
234
|
+
"resolve_domain_fail_tips": "无法解析域名 {{ domain }}: ",
|
|
234
235
|
"select_ssh_public_key_prompt": "选择使用的公钥",
|
|
235
|
-
"unzip_sync_not_exist_fail": "{{zipPath}} 找不到该文件",
|
|
236
|
-
"unzip_sync_not_exist_file_log": "压缩包中没有找到 {{entry}} 文件"
|
|
236
|
+
"unzip_sync_not_exist_fail": "{{ zipPath }} 找不到该文件",
|
|
237
|
+
"unzip_sync_not_exist_file_log": "压缩包中没有找到 {{ entry }} 文件"
|
|
237
238
|
}
|
|
238
239
|
},
|
|
239
240
|
"script": {
|
package/lib/shellapi.js
CHANGED
|
@@ -23,7 +23,7 @@ function getShellAPIConfigDir() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
class ShellApi {
|
|
26
|
-
constructor() {}
|
|
26
|
+
constructor() { }
|
|
27
27
|
|
|
28
28
|
async init() {
|
|
29
29
|
// 检查当前 shell 环境上下文是否配置 HTTP_PROXY
|
|
@@ -40,15 +40,15 @@ class ShellApi {
|
|
|
40
40
|
'lzc_cli.lib.shellapi.init.conf_file_not_exist_warn',
|
|
41
41
|
`WARN:: 读取不到以下路径中的文件,无法连接客户端自动判读盒子名称和盒子用户,
|
|
42
42
|
|
|
43
|
-
{{addrFile}} 盒子的连接地址
|
|
44
|
-
{{credFile}} 盒子的连接凭证
|
|
43
|
+
{{ addrFile }} 盒子的连接地址
|
|
44
|
+
{{ credFile }} 盒子的连接凭证
|
|
45
45
|
|
|
46
46
|
但可使用环境变量指定:
|
|
47
47
|
- BOX_NAME=foo 指定盒子的名称
|
|
48
48
|
- BOX_UID=bar 指定盒子的用户
|
|
49
49
|
|
|
50
50
|
NOTE:在指定环境变量的模式下,有些接口依旧不能访问,为了更好的开发体验,建议尽量在同主机的环境下启动客户端`,
|
|
51
|
-
{ addrFile, credFile },
|
|
51
|
+
{ addrFile, credFile, interpolation: { escapeValue: false } },
|
|
52
52
|
),
|
|
53
53
|
);
|
|
54
54
|
const md = new grpc.Metadata();
|
|
@@ -134,7 +134,7 @@ NOTE:在指定环境变量的模式下,有些接口依旧不能访问,为
|
|
|
134
134
|
const boxes = await this.boxList();
|
|
135
135
|
const box = boxes.find((b) => b.box_name === boxname);
|
|
136
136
|
if (!box) {
|
|
137
|
-
throw t('lzc_cli.lib.shellapi.set_default_box.box_not_exists_fail', '{{boxname}} 盒子不存在', { boxname });
|
|
137
|
+
throw t('lzc_cli.lib.shellapi.set_default_box.box_not_exists_fail', '{{ boxname }} 盒子不存在', { boxname });
|
|
138
138
|
}
|
|
139
139
|
return new Promise((resolve, reject) => {
|
|
140
140
|
this.client.modifyBoxConfig({ id: box.id, name: box.box_name, set_as_default_box: true }, this.metadata, function (err) {
|
package/lib/utils.js
CHANGED
|
@@ -30,7 +30,7 @@ export function checkNodejsVersion() {
|
|
|
30
30
|
const requiredVersion = pkgInfo.engines.node;
|
|
31
31
|
if (!semver.satisfies(process.version, requiredVersion)) {
|
|
32
32
|
logger.error(
|
|
33
|
-
t('lzc_cli.lib.utils.check_nodejs_version_no_match_tips', `检测到您当前的 nodejs 版本 {{version}} 不匹配,lzc-cli 最低要求 nodejs 版本为 {{requiredVersion}}, 请升级`, {
|
|
33
|
+
t('lzc_cli.lib.utils.check_nodejs_version_no_match_tips', `检测到您当前的 nodejs 版本 {{ version }} 不匹配,lzc-cli 最低要求 nodejs 版本为 {{ requiredVersion }}, 请升级`, {
|
|
34
34
|
version: process.version,
|
|
35
35
|
requiredVersion,
|
|
36
36
|
}),
|
|
@@ -55,19 +55,21 @@ export async function getLatestVersion(controller, pkgName = pkgInfo.name) {
|
|
|
55
55
|
const latestVersion = content['tags']['latest'];
|
|
56
56
|
if (semver.lt(pkgInfo.version, latestVersion)) {
|
|
57
57
|
logger.warn(
|
|
58
|
-
t('lzc_cli.lib.utils.get_latest_version_tips', `检测到 {{pkgName}} 最新版本为 {{latestVersion}},使用 'npm i -g {{pkgName}}@{{latestVersion}}' 升级到最新版本!`, {
|
|
58
|
+
t('lzc_cli.lib.utils.get_latest_version_tips', `检测到 {{ pkgName }} 最新版本为 {{ latestVersion }},使用 'npm i -g {{ pkgName }}@{{ latestVersion }}' 升级到最新版本!`, {
|
|
59
59
|
pkgName,
|
|
60
60
|
latestVersion,
|
|
61
|
+
interpolation: { escapeValue: false }
|
|
61
62
|
}),
|
|
62
63
|
);
|
|
63
64
|
} else {
|
|
64
|
-
logger.debug(t('lzc_cli.lib.utils.get_latest_version_success_tips', `已经在最新版本: {{latestVersion}}`, { latestVersion }));
|
|
65
|
+
logger.debug(t('lzc_cli.lib.utils.get_latest_version_success_tips', `已经在最新版本: {{ latestVersion }}`, { latestVersion }));
|
|
65
66
|
}
|
|
66
67
|
} catch (err) {
|
|
67
68
|
logger.debug(
|
|
68
|
-
t('lzc_cli.lib.utils.get_latest_version_fail_tips', `请求 {{url}} 失败, error: {{err}}`, {
|
|
69
|
+
t('lzc_cli.lib.utils.get_latest_version_fail_tips', `请求 {{ url }} 失败, error: {{ err }}`, {
|
|
69
70
|
url,
|
|
70
71
|
err,
|
|
72
|
+
interpolation: { escapeValue: false }
|
|
71
73
|
}),
|
|
72
74
|
);
|
|
73
75
|
}
|
|
@@ -139,9 +141,10 @@ export function ensureDirectoryExists(filePath, isRenameOrClear) {
|
|
|
139
141
|
if (err.code === 'ENOENT') {
|
|
140
142
|
fs.mkdirSync(filePath, { recursive: true });
|
|
141
143
|
} else {
|
|
142
|
-
throw t('lzc_cli.lib.utils.ensure_directory_exists_fail', `创建文件夹{{filePath}}错误: {{err}}`, {
|
|
144
|
+
throw t('lzc_cli.lib.utils.ensure_directory_exists_fail', `创建文件夹{{ filePath }}错误: {{ err }}`, {
|
|
143
145
|
filePath,
|
|
144
146
|
err,
|
|
147
|
+
interpolation: { escapeValue: false }
|
|
145
148
|
});
|
|
146
149
|
}
|
|
147
150
|
}
|
|
@@ -361,7 +364,7 @@ export async function md5File(filepath) {
|
|
|
361
364
|
}
|
|
362
365
|
|
|
363
366
|
export class Downloader {
|
|
364
|
-
constructor() {}
|
|
367
|
+
constructor() { }
|
|
365
368
|
|
|
366
369
|
showDownloadingProgress(received, total) {
|
|
367
370
|
let percentage = ((received * 100) / total).toFixed(2);
|
|
@@ -515,7 +518,7 @@ export async function resolveDomain(domain, quiet = false) {
|
|
|
515
518
|
}
|
|
516
519
|
} catch (error) {
|
|
517
520
|
if (!quiet) {
|
|
518
|
-
logger.error(t('lzc_cli.lib.utils.resolve_domain_fail_tips', `无法解析域名 {{domain}}: `, { domain }), error);
|
|
521
|
+
logger.error(t('lzc_cli.lib.utils.resolve_domain_fail_tips', `无法解析域名 {{ domain }}: `, { domain, interpolation: { escapeValue: false } }), error);
|
|
519
522
|
}
|
|
520
523
|
throw error;
|
|
521
524
|
}
|
|
@@ -523,7 +526,7 @@ export async function resolveDomain(domain, quiet = false) {
|
|
|
523
526
|
|
|
524
527
|
export function unzipSync(zipPath, destPath, entries = []) {
|
|
525
528
|
if (!isFileExist(zipPath)) {
|
|
526
|
-
throw t('lzc_cli.lib.utils.unzip_sync_not_exist_fail', `{{zipPath}} 找不到该文件`, { zipPath });
|
|
529
|
+
throw t('lzc_cli.lib.utils.unzip_sync_not_exist_fail', `{{ zipPath }} 找不到该文件`, { zipPath, interpolation: { escapeValue: false } });
|
|
527
530
|
}
|
|
528
531
|
|
|
529
532
|
// 确保目标目录存在
|
|
@@ -536,7 +539,7 @@ export function unzipSync(zipPath, destPath, entries = []) {
|
|
|
536
539
|
try {
|
|
537
540
|
zip.extractEntryTo(entry, destPath, false, true);
|
|
538
541
|
} catch {
|
|
539
|
-
logger.debug(t('lzc_cli.lib.utils.unzip_sync_not_exist_file_log', `压缩包中没有找到 {{entry}} 文件`, { entry }));
|
|
542
|
+
logger.debug(t('lzc_cli.lib.utils.unzip_sync_not_exist_file_log', `压缩包中没有找到 {{ entry }} 文件`, { entry, interpolation: { escapeValue: false } }));
|
|
540
543
|
}
|
|
541
544
|
});
|
|
542
545
|
} else {
|
|
@@ -647,12 +650,12 @@ export function checkRsync() {
|
|
|
647
650
|
const versionMatch = check.stdout.match(/rsync\s+version\s+(\d+\.\d+\.\d+)/i);
|
|
648
651
|
if (!versionMatch || compareVersions('3.2.0', versionMatch[1]) < 0) {
|
|
649
652
|
reject(
|
|
650
|
-
t('lzc_cli.lib.utils.check_rsync_version_no_match_fail', `当前 rsync 版本为:{{versionMatch}}, 要求 rsync 版本为: 3.2.0+`, {
|
|
653
|
+
t('lzc_cli.lib.utils.check_rsync_version_no_match_fail', `当前 rsync 版本为:{{ versionMatch }}, 要求 rsync 版本为: 3.2.0+`, {
|
|
651
654
|
versionMatch: versionMatch[1],
|
|
652
655
|
}),
|
|
653
656
|
);
|
|
654
657
|
}
|
|
655
|
-
logger.debug(t('lzc_cli.lib.utils.check_rsync_version_print_log', `当前 rsync 版本为:{{versionMatch}}`, { versionMatch: versionMatch[1] }));
|
|
658
|
+
logger.debug(t('lzc_cli.lib.utils.check_rsync_version_print_log', `当前 rsync 版本为:{{ versionMatch }}`, { versionMatch: versionMatch[1] }));
|
|
656
659
|
} else {
|
|
657
660
|
reject(t('lzc_cli.lib.utils.check_rsync_version_fail', '请检查 rsync 安装是否正确,指定 rsync --version 错误'));
|
|
658
661
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazycatcloud/lzc-cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "lazycat cloud developer kit",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "release-it patch",
|
|
7
7
|
"prepublishOnly": "node check-changelog.js",
|
|
8
|
-
"i18n:parser": "i18next-cli extract -c i18next.config.js && prettier -w ./lib/i18n/locales"
|
|
8
|
+
"i18n:parser": "i18next-cli extract -c i18next.config.js --sync-all && prettier -w ./lib/i18n/locales"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"template",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"inquirer": "^10.1.8",
|
|
50
50
|
"isbinaryfile": "^5.0.2",
|
|
51
51
|
"js-yaml": "^4.1.0",
|
|
52
|
+
"lodash": "^4.17.23",
|
|
52
53
|
"lodash.debounce": "^4.0.8",
|
|
53
54
|
"lodash.merge": "^4.6.2",
|
|
54
55
|
"lodash.mergewith": "^4.6.2",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
63
64
|
"@types/command-exists": "^1.2.3",
|
|
64
|
-
"i18next-cli": "^1.
|
|
65
|
+
"i18next-cli": "^1.32.0",
|
|
65
66
|
"prettier": "^3.3.3",
|
|
66
67
|
"release-it": "^19.0.4"
|
|
67
68
|
},
|