winsmux 0.23.0 → 0.24.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.
- package/README.md +9 -0
- package/install.ps1 +37 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,3 +69,12 @@ longer part of the selected profile are removed from `~\.winsmux\winsmux-core\sc
|
|
|
69
69
|
- the publish workflow stays tag-driven
|
|
70
70
|
- the publish job uses the staged package from `scripts/stage-npm-release.mjs`
|
|
71
71
|
- the publish job requires the repository `NPM_TOKEN` secret
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
The public npm package is Apache-2.0.
|
|
76
|
+
Some runtime compatibility code in the repository keeps an upstream MIT notice.
|
|
77
|
+
See the repository notices for provenance details:
|
|
78
|
+
|
|
79
|
+
- https://github.com/Sora-bluesky/winsmux/blob/main/core/LICENSE
|
|
80
|
+
- https://github.com/Sora-bluesky/winsmux/blob/main/THIRD_PARTY_NOTICES.md
|
package/install.ps1
CHANGED
|
@@ -12,7 +12,7 @@ param(
|
|
|
12
12
|
$ErrorActionPreference = 'Stop'
|
|
13
13
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
14
14
|
|
|
15
|
-
$VERSION = "0.
|
|
15
|
+
$VERSION = "0.24.0"
|
|
16
16
|
$WINSMUX_DIR = Join-Path $HOME ".winsmux"
|
|
17
17
|
$BIN_DIR = Join-Path $WINSMUX_DIR "bin"
|
|
18
18
|
$BACKUP_DIR = Join-Path $WINSMUX_DIR "backups"
|
|
@@ -249,13 +249,44 @@ function Get-PreferredReleaseAssetName {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
function Get-WinsmuxCommandVersion {
|
|
253
|
+
param([Parameter(Mandatory = $true)]$CommandInfo)
|
|
254
|
+
|
|
255
|
+
try {
|
|
256
|
+
$output = (& $CommandInfo.Source -V 2>&1 | Out-String).Trim()
|
|
257
|
+
if ($LASTEXITCODE -ne 0) {
|
|
258
|
+
return $null
|
|
259
|
+
}
|
|
260
|
+
if ($output -match 'winsmux(?:-[^\s]+)?\s+(?<version>\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)') {
|
|
261
|
+
return [PSCustomObject]@{
|
|
262
|
+
Version = $Matches.version
|
|
263
|
+
Output = $output
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} catch {
|
|
267
|
+
return $null
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return $null
|
|
271
|
+
}
|
|
272
|
+
|
|
252
273
|
function Install-WinsmuxBinary {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
274
|
+
$existing = Get-Command winsmux -ErrorAction SilentlyContinue
|
|
275
|
+
if ($existing) {
|
|
276
|
+
$detected = Get-WinsmuxCommandVersion -CommandInfo $existing
|
|
277
|
+
if ($detected -and $detected.Version -eq $VERSION) {
|
|
278
|
+
Write-Status "winsmux found: $($detected.Output)"
|
|
279
|
+
return
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if ($detected) {
|
|
283
|
+
Write-Warning "[winsmux] Existing winsmux version '$($detected.Version)' does not match installer version '$VERSION'. Reinstalling release binary."
|
|
284
|
+
} else {
|
|
285
|
+
Write-Warning "[winsmux] Existing winsmux command did not return a compatible version. Reinstalling release binary."
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
Write-Status "winsmux binary not found. Downloading winsmux-core..."
|
|
257
289
|
}
|
|
258
|
-
Write-Status "winsmux binary not found. Downloading winsmux-core..."
|
|
259
290
|
|
|
260
291
|
$localBin = Join-Path $HOME ".local/bin"
|
|
261
292
|
$winsmuxExe = Join-Path $localBin "winsmux.exe"
|