On Monday, December 8, 2014 4:09:34 AM UTC-5, Rupali wrote:
>
> But below produces output as *Current directory is: ${myDir}*
> node('windows') {
> def myDir = pwd()
> bat '''echo "Current directory is:"
> echo ${myDir}'''
> }
>
> Am I missing some syntax in multiple line batch script?
>
Groovy qu
Hi Kohsuke,
I am new to Groovy. So I guess I couldn't figure out the issue.
But setting env.MYDIR and accessing it as %MYDIR% in batch script worked.
Thanks for quick response.
Regards,
Rupali
On Monday, December 8, 2014 9:35:29 PM UTC+5:30, Kohsuke Kawaguchi wrote:
>
> I've never used 2x double
I've never used 2x doublequote string in Groovy, but in any case this
sounds like a Groovy question.
Aside from String formatting like ${...}, you can also explicitly set a
value to environment variable by:
env.MYDIR= pwd()
then every process forked within the block scope will have such an
en
Hi,
I tried reading variables in batch script. It works if its a single line
batch code, but doesn't for multiple lines.
e.g.
Below outputs current directory path correctly.
node('windows') {
def myDir = pwd()
bat "echo ${myDir}"
}
But below produces output as *Current directory is: ${myDir}*