mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 20:50:06 +00:00
fix(windows): stabilize install and prerelease versioning
This commit is contained in:
@@ -20,15 +20,15 @@ Set-StrictMode -Version Latest
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$projectRoot = Split-Path -Parent $scriptDir
|
||||
$releaseDir = Join-Path $projectRoot "release"
|
||||
$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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@ $projectRoot = Split-Path -Parent $scriptDir
|
||||
$releaseDir = Join-Path $projectRoot "release"
|
||||
$binDir = Join-Path $projectRoot "bin"
|
||||
$cmdDir = Join-Path $projectRoot "cmd"
|
||||
$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