Skip to content

Commit

Permalink
Fix build error when running componentTests on PowerShell (#12482)
Browse files Browse the repository at this point in the history
The previous strategy of choosing the command for deleting temporary
files relied on the Windows CMD command `del`. This command does not
exist in PowerShell, so the task fails.

Thankfully, there is a `delete` task we can use. This task takes care of
platform differences for us.

Co-authored-by: Dominic Lim <[email protected]>
  • Loading branch information
guilherme-puida and domlimm committed Jun 26, 2023
1 parent c5389d2 commit 86c328b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,8 @@ def afterTestClosure = { descriptor, result ->
def process = "${diffCommand} ${expectedFileName} ${actualFileName}".execute()
println process.getText()
process.waitFor()
def deleteCommand = isWindows ? "del" : "rm"
"${deleteCommand} ${expectedFileName}".execute()
"${deleteCommand} ${actualFileName}".execute()
delete expectedFileName
delete actualFileName
} else {
println "${result.exception.getClass().getName()}: ${result.exception.getMessage()}"
}
Expand Down

0 comments on commit 86c328b

Please sign in to comment.