geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r510807 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
Date Fri, 23 Feb 2007 04:25:47 GMT
Author: jdillon
Date: Thu Feb 22 20:25:46 2007
New Revision: 510807

URL: http://svn.apache.org/viewvc?view=rev&rev=510807
Log:
Allow failonerror to be set (or not)
Clean up extra ws

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy?view=diff&rev=510807&r1=510806&r2=510807
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
Thu Feb 22 20:25:46 2007
@@ -26,7 +26,7 @@
 import gbuild.system.LogSupport
 
 /**
- * Helper to execute shell commands
+ * Helper to execute shell (/bin/sh) scripts.
  */
 class ShellExecutor extends LogSupport
 {
@@ -34,6 +34,8 @@
     
     private List body = []
     
+    boolean failOnError = false
+    
     def ShellExecutor() {
         body << '#!/bin/sh'
     }
@@ -56,7 +58,7 @@
         
         scriptFile.withPrintWriter { writer ->
             body.each {
-                writer.println(it)
+                writer.println(it.trim())
             }
         }
         
@@ -74,7 +76,7 @@
             // Ant does not like to replace props, so make a unique one each time
             def propname = 'shell-executor.' + UUID.randomUUID()
             
-            ant.exec(executable: scriptFile, outputproperty: propname) {
+            ant.exec(executable: scriptFile, failonerror: failOnError, outputproperty: propname)
{
                 if (args) {
                     args.each {
                         arg(value: it)



Mime
View raw message