multi-terminals 0.5.13 → 0.7.0

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.
@@ -50,28 +50,31 @@ const flag = (...names) => names.some((name) => args.includes(name))
50
50
  const command = args.find((arg) => !arg.startsWith('-')) ?? 'run'
51
51
  const dryRun = flag('--dry-run')
52
52
 
53
- const USAGE = `MultiTerminals ${version} —— Windows 多项目终端工作台
53
+ const USAGE = `MultiTerminals ${version} — a Windows workspace for multiple terminal projects
54
54
 
55
- 用法:
56
- multi-terminals 启动应用;没装就先装,装了旧版本就先覆盖升级
57
- multi-terminals install 安装,或覆盖已有安装(不需要先卸载)
55
+ Usage:
56
+ multi-terminals Launch the app; install it first if missing, upgrade in place if old
57
+ multi-terminals install Install, or upgrade an existing install (no uninstall needed)
58
58
  multi-terminals install --silent
59
- 无人值守安装,装完直接启动
60
- multi-terminals uninstall 运行已装好的卸载程序
61
- multi-terminals --version 打印版本
62
- multi-terminals --help 显示这段说明
59
+ Unattended install that launches the app when done
60
+ multi-terminals uninstall Run the installed uninstaller
61
+ multi-terminals --version Print the version
62
+ multi-terminals --help Show this text
63
63
 
64
- 选项:
65
- -s, --silent 安装时不弹向导(等价于 NSIS 的 /S)
66
- -y, --yes 检测到旧版本时不再询问,直接覆盖升级
67
- --dry-run 只打印将要执行的命令行,不真的执行
64
+ Options:
65
+ -s, --silent Skip the installer wizard (same as NSIS /S)
66
+ -y, --yes Do not ask when an older version is found; upgrade in place
67
+ --dry-run Print the command line that would run, without running it
68
68
 
69
- 说明:
70
- 升级是覆盖安装:检测到旧版本时先问一句,然后用安装包的 /S /UPDATE 直接覆盖,
71
- 不需要手动卸载,也不会留下旧版本的文件(程序、daemon、卸载器按名字替换)。
72
- 安装程序会关闭正在运行的 MultiTerminals 窗口(交互模式会先问一句,--silent 下不问)。
73
- 终端不会因此中断:终端由独立进程 daemon 持有,安装程序不会碰它。
74
- 工作区、标签和布局保存在 %APPDATA%\\MultiTerminals,安装、升级、卸载都不会删除。`
69
+ Notes:
70
+ Upgrading is an overwrite install: when an older version is found it asks once, then
71
+ runs the package with /S /UPDATE. No manual uninstall, and no files from the old
72
+ version are left behind (app, daemon and uninstaller are replaced by name).
73
+ The installer closes a running MultiTerminals window (it asks first interactively,
74
+ not under --silent).
75
+ Terminals are not interrupted: they live in a separate daemon the installer never touches.
76
+ Workspaces, tabs and layouts stay in %APPDATA%\\MultiTerminals; install, upgrade and
77
+ uninstall never delete them.`
75
78
 
76
79
  function fail(message, code = 1) {
77
80
  console.error(message)
@@ -147,13 +150,13 @@ function compareVersions(left, right) {
147
150
  async function confirmUpgrade(installed) {
148
151
  if (dryRun || flag('--yes', '-y') || flag('--silent', '-s') || !process.stdin.isTTY) return true
149
152
  const prompt =
150
- `检测到已安装 MultiTerminals ${installed ?? '(版本未知)'},当前包是 ${version}。\n` +
151
- '将直接覆盖安装,不需要手动卸载;程序窗口会被关闭再重开,终端和工作区不受影响。\n' +
152
- '继续?[Y/n] '
153
+ `Detected MultiTerminals ${installed ?? '(unknown version)'}; this package is ${version}.\n` +
154
+ 'Installing over it; no manual uninstall needed. The app window is closed and reopened; terminals and workspaces are unaffected.\n' +
155
+ 'Continue? [Y/n] '
153
156
  const rl = createInterface({ input: process.stdin, output: process.stdout })
154
157
  try {
155
158
  const answer = (await rl.question(prompt)).trim().toLowerCase()
156
- return answer === '' || answer.startsWith('y') || answer === '是'
159
+ return answer === '' || answer.startsWith('y')
157
160
  } finally {
158
161
  rl.close()
159
162
  }
@@ -172,8 +175,8 @@ function runInstaller({ silent, update = false }) {
172
175
  console.log(`[dry-run] ${line}`)
173
176
  return
174
177
  }
175
- if (update) console.log(`正在覆盖安装 MultiTerminals ${version}(不需要先卸载)…`)
176
- else console.log(silent ? '正在静默安装…' : '正在打开安装向导…')
178
+ if (update) console.log(`Installing over MultiTerminals ${version} (no uninstall needed)…`)
179
+ else console.log(silent ? 'Installing silently…' : 'Opening the installer wizard…')
177
180
  const result = spawnSync(installer, installerArgs, { stdio: 'inherit', windowsHide: false })
178
181
  if (result.error) fail(`could not run the installer: ${result.error.message}`)
179
182
  // NSIS reports its own failures in a dialog and still exits 0 often enough that the
@@ -190,7 +193,7 @@ function overwriteInstall() {
190
193
  if (dryRun) return null
191
194
  const now = installedApp()
192
195
  if (!now) {
193
- fail('覆盖安装似乎没有完成:注册表里没有 MultiTerminals,默认目录下也没有可执行文件。请重新执行一次,或手动运行安装包。', 1)
196
+ fail('The overwrite install did not seem to finish: MultiTerminals is not in the registry and there is no executable in the default directory. Run it again, or run the installer by hand.', 1)
194
197
  }
195
198
  return now
196
199
  }
@@ -202,7 +205,7 @@ function launch(exe) {
202
205
  }
203
206
  const child = spawn(exe, [], { detached: true, stdio: 'ignore' })
204
207
  child.unref()
205
- console.log(`已启动 ${exe}`)
208
+ console.log(`Launched ${exe}`)
206
209
  }
207
210
 
208
211
  if (flag('--help', '-h') || command === 'help') {
@@ -215,7 +218,7 @@ if (flag('--version', '-v') || command === 'version') {
215
218
  }
216
219
 
217
220
  if (process.platform !== 'win32') {
218
- fail('MultiTerminals 是 Windows x64 应用,这个包在别的平台上装不了。')
221
+ fail('MultiTerminals is a Windows x64 app; this package cannot be installed on another platform.')
219
222
  }
220
223
 
221
224
  switch (command) {
@@ -224,9 +227,9 @@ switch (command) {
224
227
  if (already) {
225
228
  const current = installedVersion()
226
229
  if (compareVersions(current, version) < 0) {
227
- console.log(`检测到已安装 ${current ?? '(版本未知)'},将覆盖升级到 ${version}。`)
230
+ console.log(`Detected ${current ?? '(unknown version)'}; upgrading in place to ${version}.`)
228
231
  if (!(await confirmUpgrade(current))) {
229
- console.log('已取消,什么都没有改动。')
232
+ console.log('Cancelled; nothing was changed.')
230
233
  break
231
234
  }
232
235
  const now = overwriteInstall()
@@ -241,8 +244,8 @@ switch (command) {
241
244
  runInstaller({ silent: false })
242
245
  const now = installedApp()
243
246
  if (dryRun) break
244
- if (!now) fail('安装似乎没有完成:注册表里没有 MultiTerminals,默认目录下也没有可执行文件。', 1)
245
- console.log(`已安装到 ${now}\n向导最后一页可以勾选启动;也可以再执行一次 multi-terminals。`)
247
+ if (!now) fail('The install did not seem to finish: MultiTerminals is not in the registry and there is no executable in the default directory.', 1)
248
+ console.log(`Installed to ${now}\nThe last wizard page can launch it; you can also run multi-terminals again.`)
246
249
  break
247
250
  }
248
251
  case 'install': {
@@ -250,12 +253,12 @@ switch (command) {
250
253
  if (installedApp()) {
251
254
  const current = installedVersion()
252
255
  if (compareVersions(current, version) < 0) {
253
- console.log(`检测到已安装 ${current ?? '(版本未知)'},将覆盖升级到 ${version}。`)
256
+ console.log(`Detected ${current ?? '(unknown version)'}; upgrading in place to ${version}.`)
254
257
  } else if (compareVersions(current, version) > 0) {
255
- console.log(`已安装的 ${current} 比这个包(${version})新,将降级覆盖安装。`)
258
+ console.log(`${current} is newer than this package (${version}); installing the older version over it.`)
256
259
  }
257
260
  if (!(await confirmUpgrade(current))) {
258
- console.log('已取消,什么都没有改动。')
261
+ console.log('Cancelled; nothing was changed.')
259
262
  break
260
263
  }
261
264
  const now = overwriteInstall()
@@ -265,17 +268,17 @@ switch (command) {
265
268
  runInstaller({ silent })
266
269
  if (dryRun) break
267
270
  const now = installedApp()
268
- if (!now) fail('安装似乎没有完成:注册表里没有 MultiTerminals,默认目录下也没有可执行文件。', 1)
271
+ if (!now) fail('The install did not seem to finish: MultiTerminals is not in the registry and there is no executable in the default directory.', 1)
269
272
  // The finish page is skipped under `/S`, so a silent install leaves nothing running.
270
273
  if (silent) launch(now)
271
- else console.log(`已安装到 ${now}`)
274
+ else console.log(`Installed to ${now}`)
272
275
  break
273
276
  }
274
277
  case 'uninstall': {
275
278
  const dir = installedDir()
276
279
  const uninstaller = dir ? path.join(dir, 'uninstall.exe') : null
277
280
  if (!uninstaller || !existsSync(uninstaller)) {
278
- fail('没有找到卸载程序;MultiTerminals 可能本来就没装。', 2)
281
+ fail('No uninstaller found; MultiTerminals may not be installed.', 2)
279
282
  }
280
283
  if (dryRun) {
281
284
  console.log(`[dry-run] ${uninstaller}`)
@@ -283,9 +286,9 @@ switch (command) {
283
286
  }
284
287
  const result = spawnSync(uninstaller, [], { stdio: 'inherit', windowsHide: false })
285
288
  if (result.error) fail(`could not run the uninstaller: ${result.error.message}`)
286
- console.log('工作区、标签和布局仍保留在 %APPDATA%\\MultiTerminals,需要的话请手动删除。')
289
+ console.log('Workspaces, tabs and layouts stay in%APPDATA%\\MultiTerminals; delete them by hand if you want them gone.')
287
290
  break
288
291
  }
289
292
  default:
290
- fail(`未知命令:${command}\n\n${USAGE}`, 2)
293
+ fail(`Unknown command: ${command}\n\n${USAGE}`, 2)
291
294
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "multi-terminals",
3
- "version": "0.5.13",
4
- "description": "轻量的 Windows 多项目终端工作台:关窗口不会结束终端",
3
+ "version": "0.7.0",
4
+ "description": "A lightweight Windows workspace for multiple terminal projects: closing the window does not end your terminals",
5
5
  "keywords": [
6
6
  "terminal",
7
7
  "workspace",
Binary file