Skip to content

Commit

Permalink
Ignore git if not installed when running build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Nov 29, 2022
1 parent c2f37de commit ffcdd8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ if ($args[1]) {
}

$majorVer = Get-Content VERSION
$lastVer = git tag --sort version:refname --list "$majorVer.*" | Select -last 1
if (Get-Command "git.exe" -ErrorAction SilentlyContinue) {
$lastVer = git tag --sort version:refname --list "$majorVer.*" | Select -last 1
}

echo "Configuration: $configuration"
echo "BuildPath: $path"
echo "Major: $majorVer"
echo "lastVer: $lastVer"

if ($lastVer -ne "") {
if ($lastVer) {
$nextVer = $lastVer.Split('.')
$lastItem = $nextVer.Length-1
$nextVer[$lastItem] = [int]$nextVer[$lastItem] + 1
$nextVer = $nextVer -Join '.'
} else {
$nextVer="$majorVer.0"
}
echo "nextVer: $nextVer"

dotnet --list-sdks -or winget install Microsoft.DotNet.SDK.6
dotnet build --configuration "$configuration" "/property:Version=$nextVer" --output "$path"

0 comments on commit ffcdd8f

Please sign in to comment.