multi-terminals 0.5.12 → 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.
|
Binary file
|
package/bin/multi-terminals.mjs
CHANGED
|
@@ -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}
|
|
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
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
151
|
-
'
|
|
152
|
-
'
|
|
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')
|
|
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(
|
|
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('
|
|
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(
|
|
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
|
|
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(
|
|
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('
|
|
245
|
-
console.log(
|
|
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(
|
|
256
|
+
console.log(`Detected ${current ?? '(unknown version)'}; upgrading in place to ${version}.`)
|
|
254
257
|
} else if (compareVersions(current, version) > 0) {
|
|
255
|
-
console.log(
|
|
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('
|
|
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(
|
|
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('
|
|
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('
|
|
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(
|
|
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.
|
|
4
|
-
"description": "
|
|
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
|