From 5672ad96b06ec684fca78db781e6cd1df7fca63c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 29 Apr 2017 23:05:22 -0700 Subject: [PATCH] Examples cleanup. --- README.md | 5 +++-- example/kobalt/src/Build.kt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ed85eb..527f34e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ The `commandLine` directive is used to execute command line(s) during the build exec { commandLine("cmd", "/c", "stop.bat", dir = "../tomcat/bin", os = setOf(Os.WINDOWS)) commandLine("./stop.sh", dir = "../tomcat/bin", os = setOf(Os.MAC, Os.LINUX)) - commandLine("sh", "-c", "ps aux | grep tomcat", fail = setOf(Fail.EXIT)) + commandLine("sh", "-c", "ps aux | grep tomcat", os = setOf(Os.MAC, Os.LINUX), fail = setOf(Fail.EXIT)) + commandLine("cmd", "/c", "tasklist | find \"tomcat\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.EXIT)) } ``` @@ -165,7 +166,7 @@ You could also redirect the error stream to a file: ```kotlin exec { - commandLine("/bin/sh", "-c", "./stop.sh 2> error.txt", os = setOf(Os.LINUX)) + commandLine("sh", "-c", "./stop.sh 2> error.txt", os = setOf(Os.LINUX)) commandLine("cmd", "/c", "stop.bat 2> error.txt", os = setOf(Os.WINDOWS)) } ``` \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index a9dfbb1..a6ae3f1 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -39,14 +39,14 @@ val example = project { dependsOn = listOf("exec", "run") val echo = arrayOf("echo", "Test", "Example") - commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS)) commandLine(*echo, os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) + commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS)) } exec { taskName = "ps" dependsOn = listOf() // no dependencies - commandLine("cmd", "/c", "tasklist | find \"cmd.exe\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.NONE)) commandLine("sh", "-c", "ps aux | grep bash", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) + commandLine("cmd", "/c", "tasklist | find \"cmd.exe\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.EXIT)) } } \ No newline at end of file