From 86c328b43dc294c2be0bb6e1d5367dc4184edd83 Mon Sep 17 00:00:00 2001 From: Guilherme Puida Date: Mon, 26 Jun 2023 15:40:29 -0300 Subject: [PATCH] Fix build error when running componentTests on PowerShell (#12482) 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 <46486515+domlimm@users.noreply.github.com> --- build.gradle | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e219433d9db..8351633e18d 100644 --- a/build.gradle +++ b/build.gradle @@ -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()}" }