Package gmbh.pagina.tools.gradle.mac_app
Class Shell
java.lang.Object
gmbh.pagina.tools.gradle.mac_app.Shell
An object to interact with the system shell.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected static ShellExecute a shell command but do not throw on a non-zero exit code.String[]getLines()Return the output lines of the message.booleanisOk()Has the shell terminated correctly with a normal exit code.protected static ShellExecute a shell command.protected static ShellExecute a shell command in a specific working directory.protected static booleanTest whether a shell command is successful.
-
Field Details
-
out
The shell output, stdout and stderr. -
exitcode
public final int exitcodeThe exit code of the shell call.
-
-
Method Details
-
isOk
public boolean isOk()Has the shell terminated correctly with a normal exit code.- Returns:
truewhen the process exit code is zero.
-
getLines
Return the output lines of the message.- Returns:
- output split by line separator.
-
test
Test whether a shell command is successful. Long output is truncated.- Parameters:
command- Command and arguments.- Returns:
truewhen the command exits with code zero.
-
failOk
Execute a shell command but do not throw on a non-zero exit code.- Parameters:
command- Command and arguments.- Returns:
- Shell result including output and exit code.
-
sh
Execute a shell command.- Parameters:
command- Command and arguments.- Returns:
- Shell result including output and exit code.
-
shInDir
Execute a shell command in a specific working directory.- Parameters:
workingDirectory- Working directory used for command execution.command- Command and arguments.- Returns:
- Shell result including output and exit code.
-