Skip to content

Commit 2c4e4b8

Browse files
committed
fix first run check
1 parent 5267131 commit 2c4e4b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ALZ/Private/Deploy-Accelerator-Helpers/New-ModuleSetup.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function New-ModuleSetup {
6363
}
6464

6565
$isAutoVersion = $release -eq "latest"
66-
$firstRun = $null -eq $currentVersion
66+
$firstRun = $null -eq $currentVersion -or $currentVersion -eq ""
6767
$shouldDownload = $false
6868

6969
if($isAutoVersion -and $upgrade.IsPresent -and $null -eq $latestReleaseTag) {
@@ -88,11 +88,11 @@ function New-ModuleSetup {
8888
if(!$shouldDownload -or $isFirstRun) {
8989
$newVersionAvailable = $false
9090
$currentCalculatedVersion = $currentVersion
91-
if($isAutoVersion -and $null -ne $latestReleaseTag -and $latestReleaseTag -ne $currentVersion) {
91+
if(!$isFirstRun -and $isAutoVersion -and $null -ne $latestReleaseTag -and $latestReleaseTag -ne $currentVersion) {
9292
$newVersionAvailable = $true
9393
}
9494

95-
if(!$isAutoVersion -and $null -ne $latestReleaseTag -and $latestReleaseTag -ne $currentVersion) {
95+
if(!$isFirstRun -and !$isAutoVersion -and $null -ne $latestReleaseTag -and $latestReleaseTag -ne $currentVersion) {
9696
$newVersionAvailable = $true
9797
}
9898

0 commit comments

Comments
 (0)