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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user