File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -37,20 +37,25 @@ Param (
3737
3838. (Join-Path $PSScriptRoot common.ps1)
3939
40- function SetOutput ($outputPath , $incomingPackageSpec ) {
41- $outputObject = $incomingPackageSpec
40+ function SetOutput ($outputPath , $incomingPackageSpec ) {
4241
43- if ($addDevVersion ) {
42+ # If there is an exsiting package info json file read that and set that as output object which gets properties updated here.
43+ if (Test-Path $outputPath )
44+ {
45+ Write-Host " Found existing package info json."
46+ $outputObject = ConvertFrom-Json (Get-Content $outputPath - Raw)
47+ }
48+ else
49+ {
50+ $outputObject = $incomingPackageSpec
51+ }
52+
53+
54+ if ($addDevVersion )
55+ {
4456 # Use the "Version" property which was provided by the incoming package spec
4557 # as the DevVersion. This may be overridden later.
4658 $outputObject.DevVersion = $incomingPackageSpec.Version
47-
48- # If there is an exsiting package info json file read that and set the
49- # Version property from that JSON file.
50- if (Test-Path $outputPath ) {
51- $originalObject = ConvertFrom-Json (Get-Content $outputPath - Raw)
52- $outputObject.Version = $originalObject.Version
53- }
5459 }
5560
5661 # Set file paths to relative paths
You can’t perform that action at this time.
0 commit comments