mirror of
https://github.com/tw93/Mole.git
synced 2026-03-23 01:25:09 +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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user