You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by "awrb (via GitHub)" <gi...@apache.org> on 2023/02/06 23:03:11 UTC

[GitHub] [karaf] awrb opened a new pull request, #1712: KARAF-6538 - add commands for executing groovy code

awrb opened a new pull request, #1712:
URL: https://github.com/apache/karaf/pull/1712

   Added two commands that activate when groovy feature is installed:
   ```
   karaf@root()> groovy:exec --help                                                                                                                                                      
   DESCRIPTION
           groovy:exec
   
           Executes Groovy code
   
   SYNTAX
           groovy:exec script [args] 
   
   ARGUMENTS
           script
                   Groovy code
                   (required)
           args
                   Arguments in the format of key=value
   
   karaf@root()> groovy:exec-file --help                                                                                                                          
   DESCRIPTION
           groovy:exec-file
   
           Executes Groovy file
   
   SYNTAX
           groovy:exec-file path 
   
   ARGUMENTS
           path
                   Groovy script file path
                   (required)
   
   
   karaf@root()> groovy:exec "1+1"
   2
   karaf@root()> groovy:exec "(x as int) + (y as int)" x=1 y=2
   3
   karaf@root()> cat /home/aleksy/test.groovy                                                                                                                                            
   def add(x, y) {
    return x + y
   }
   
   add(1,2)
   karaf@root()> groovy:exec-file /home/aleksy/test.groovy                                                                                                               
   3
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [karaf] jbonofre merged pull request #1712: KARAF-6538 - add commands for executing groovy code

Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #1712:
URL: https://github.com/apache/karaf/pull/1712


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org