Skip to content

Commit b2af260

Browse files
committed
CR feedback
1 parent 09895f5 commit b2af260

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Nodejs/Setup/BuildRelease.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ if ($name) {
325325
$version_file_backed_up = 0
326326
# Force use of a backup if there are pending changes to $version_file
327327
$version_file_force_backup = 0
328-
$has_no_tf_workspace = (tf workspaces | Select-String -pattern "No workspace", "Unable to determine the workspace")
329-
if (-not $has_no_tf_workspace) {
328+
$has_tf_workspace = (-not (tf workspaces | Select-String -pattern "No workspace", "Unable to determine the workspace"))
329+
if ($has_tf_workspace) {
330330
if (-not (tf status $version_file /format:detailed | Select-String "There are no pending changes.")) {
331331
Write-Output "$version_file has pending changes. Using backup instead of tf undo."
332332
$version_file_force_backup = 1
@@ -436,7 +436,7 @@ if (-not $skipclean) {
436436

437437
$logdir = mkdir "$outdir\Logs" -Force
438438

439-
if ($scorch -and (-not $has_no_tf_workspace)) {
439+
if ($scorch -and $has_tf_workspace) {
440440
tfpt scorch $buildroot /noprompt
441441
}
442442

@@ -445,7 +445,7 @@ $failed_logs = @()
445445
Push-Location $buildroot
446446
try {
447447
$successful = $false
448-
if ((-not $version_file_force_backup) -and (-not $has_no_tf_workspace)) {
448+
if ((-not $version_file_force_backup) -and $has_tf_workspace) {
449449
tf edit $version_file | Out-Null
450450
}
451451
if ($version_file_force_backup -or -not $?) {
@@ -639,7 +639,7 @@ try {
639639
Set-ItemProperty $version_file -Name IsReadOnly -Value $true
640640
}
641641
Write-Output "Restored $version_file"
642-
} elseif ((-not $version_file_force_backup) -and (-not $has_no_tf_workspace)) {
642+
} elseif ((-not $version_file_force_backup) -and $has_tf_workspace) {
643643
tf undo /noprompt $version_file | Out-Null
644644
}
645645

0 commit comments

Comments
 (0)