Add support for exit codes

- New configurations to CommandRegistration
- Re-using exit code concepts from boot
- Handling exit codes only in non-interactive mode
- Adding e2e commands and tests for better coverage
- Fixes #431
This commit is contained in:
Janne Valkealahti
2022-05-30 21:26:11 +01:00
parent 08428c88cb
commit 3891a8b375
16 changed files with 707 additions and 20 deletions

View File

@@ -17,7 +17,6 @@ package org.springframework.shell.standard.commands;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import org.jline.reader.Parser;
@@ -57,7 +56,7 @@ public class Script extends AbstractShellComponent {
}
@ShellMethod(value = "Read and execute commands from a file.")
public void script(File file) throws IOException {
public void script(File file) throws Exception {
Reader reader = new FileReader(file);
try (FileInputProvider inputProvider = new FileInputProvider(reader, parser)) {
getShell().run(inputProvider);