Skip to content

[Release 1.3.0] Fixed AzureASM Storage dependency update in PS release script. #2012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions tools/ASMIncrementVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,53 @@ function IncrementVersion([string]$FilePath)
}
}

# Function to update nuspec file
function UpdateStorageVersion([string]$FilePath)
{

$psd1Path = Join-Path $FilePath "\Services\Commands.Utilities\Azure.psd1"

Write-Output "Updating File: $psd1Path"
$content = Get-Content $psd1Path
$matches = ([regex]::matches($content, "; ModuleVersion = '([\d\.]+)'"))

$packageVersion = $matches.Groups[1].Value
$version = $packageVersion.Split(".")

$cMajor = $Major
$cMinor = $Minor
$cPatch = $Patch

if ($cMajor -eq $true)
{
$version[0] = 1 + $version[0]
$version[1] = "0"
$version[2] = "0"
}

if ($cMinor -eq $true)
{
$version[1] = 1 + $version[1]
$version[2] = "0"
}

if ($cPatch -eq $true)
{
$version[2] = 1 + $version[2]
}

$version = [String]::Join(".", $version)

Write-Output "Updating version of $psd1Path from $packageVersion to $version"
$content = $content.Replace("; ModuleVersion = '$packageVersion'", "; ModuleVersion = '$version'")

Set-Content -Path $psd1Path -Value $content -Encoding UTF8
}

if (!$Folder)
{
$Folder = "$PSScriptRoot\..\src\ServiceManagement"
}

IncrementVersion $Folder
UpdateStorageVersion $Folder