CopyPastor

Detecting plagiarism made easy.

Score: 1.8298829197883606; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Reposted on 2024-05-17
by OlivierM

Original Post

Original - Posted on 2024-05-17
by OlivierM



            
Present in both answers; Present only in the new answer; Present only in the old answer;

In case you want to always see the error when the command fails:
``` task myCommandLineTask(type: Exec) { commandLine 'my_command.sh'
ignoreExitValue = true standardOutput = new ByteArrayOutputStream() doLast { def exitCode = executionResult.get().exitValue if (exitCode != 0) { def result = standardOutput.toString() logger.warn(result) throw new GradleException("Failed to run command (exit code:$exitCode)") } } } ```
Here is what I am using for newer version of gradle:
``` task myCommandLineTask(type: Exec) { commandLine 'my_command.sh'
ignoreExitValue = true standardOutput = new ByteArrayOutputStream() doLast { def exitCode = executionResult.get().exitValue if (exitCode != 0) { def result = standardOutput.toString() println result throw new GradleException("Failed to run command (exit code:$exitCode)") } } } ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;