Added opton to add a List via the command method
This commit is contained in:
parent
9843cfeb6b
commit
193c791408
6 changed files with 44 additions and 8 deletions
10
README.md
10
README.md
|
@ -29,9 +29,15 @@ constitute a failure.
|
|||
```java
|
||||
@BuildCommand
|
||||
public void startServer() throws Exception {
|
||||
final List<String> cmds;
|
||||
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
|
||||
cmds = List.of("cmd", "/c", "stop.bat");
|
||||
} else {
|
||||
cmds = List.of("./stop.sh");
|
||||
}
|
||||
new ExecOperation()
|
||||
.fromProject(this)
|
||||
.command("cmd", "/c", "stop.bat")
|
||||
.command(cmds)
|
||||
.fail(ExecFail.STDERR)
|
||||
.execute();
|
||||
}
|
||||
|
@ -61,7 +67,7 @@ public void startServer() throws Exception {
|
|||
new ExecOperation()
|
||||
.fromProject(this)
|
||||
.command("touch", "foo.txt")
|
||||
.workDir("/tmp")
|
||||
.workDir(System.getProperty("java.io.tmpdir"))
|
||||
.execute();
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue