We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b801b60 + 3960d83 commit dd35f62Copy full SHA for dd35f62
1 file changed
Nodejs/Setup/BuildRelease.ps1
@@ -323,7 +323,7 @@ if ($name) {
323
$version_file_backed_up = 0
324
# Force use of a backup if there are pending changes to $version_file
325
$version_file_force_backup = 0
326
-$has_tf_workspace = (-not (tf workspaces | Select-String -pattern "No workspace", "Unable to determine the workspace"))
+$has_tf_workspace = (Get-Command tf -errorAction SilentlyContinue) -and (-not (tf workspaces | Select-String -pattern "No workspace", "Unable to determine the workspace"))
327
if ($has_tf_workspace) {
328
if (-not (tf status $version_file /format:detailed | Select-String "There are no pending changes.")) {
329
Write-Output "$version_file has pending changes. Using backup instead of tf undo."
0 commit comments