new version handle logic

This commit is contained in:
David Refoua
2018-03-30 23:23:44 +04:30
parent 3965852c26
commit b36b8a4cb3
3 changed files with 45 additions and 7 deletions

View File

@ -58,14 +58,14 @@ $ScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$cmder_root = $ScriptRoot.replace("\scripts","")
# Dot source util functions into this scope
. ".\utils.ps1"
. "$PSScriptRoot\utils.ps1"
$ErrorActionPreference = "Stop"
Push-Location -Path $saveTo
$sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json
# Get the version string
$Version = Get-VersionStr ($PSScriptRoot + '\..\' + 'CHANGELOG.md')
$version = Get-VersionStr
# Check for requirements
Ensure-Exists $sourcesPath
@ -119,13 +119,13 @@ Pop-Location
if($Compile) {
Push-Location -Path $launcher
Create-RC $Version ($launcher + '\src\version.rc2');
Create-RC $version ($launcher + '\src\version.rc2');
msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release
if ($LastExitCode -ne 0) {
throw "msbuild failed to build the executable."
}
else {
Write-Verbose "successfully built Cmder v$Version!"
Write-Verbose "successfully built Cmder v$version!"
}
Pop-Location
} else {