1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 23:05:08 +00:00

fix(windows): stabilize install and prerelease versioning

This commit is contained in:
Tw93
2026-03-22 14:39:25 +08:00
parent 05fbc007d5
commit 16c3ea9867
13 changed files with 211 additions and 54 deletions

View File

@@ -21,15 +21,15 @@ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$projectRoot = Split-Path -Parent $scriptDir
$releaseDir = Join-Path $projectRoot "release"
$wixSource = Join-Path $scriptDir "mole-installer.wxs"
$versionFile = Join-Path $projectRoot "VERSION"
# Read version from mole.ps1 if not provided
# Read version from VERSION if not provided
if (-not $Version) {
$moleScript = Join-Path $projectRoot "mole.ps1"
$content = Get-Content $moleScript -Raw
if ($content -match '\$script:MOLE_VER\s*=\s*"([^"]+)"') {
$Version = $Matches[1]
} else {
Write-Host "Error: Could not detect version from mole.ps1" -ForegroundColor Red
if (Test-Path $versionFile) {
$Version = (Get-Content $versionFile -Raw).Trim()
}
if (-not $Version) {
Write-Host "Error: Could not detect version from VERSION" -ForegroundColor Red
exit 1
}
}