Hello Robin
In one of my step, which is a build of shell/batch command type, I am trying to execute the command through groovy, because the command line is stored in a var (in the 2nd line to be specific). So in the command window, my whole script is this:
${groovy:
def value = vars.getValue("var_with_cmd");
def cmd = "";
value.eachLine {line, count -> if (count == 1) cmd = line; };
return cmd;
}
however, it keeps giving me the syntax error as follows:
script1507660946877568731772.groovy: 4: expecting '}', found '' @ line 4, column 59.
-> if (count == 1) cmd = line;
^
1 error
I can't figure out what happened. I just know it's about the usage of embedding groovy script.
Thank you for your help
- solved #2
- replies 1
- views 2294
- stars 0