According to the docs, one can have multiple lines in the script paramater of bat.
However, I've tried the following in my stage steps and only the first line gets executed.
Declarative pipeline:
...
bat """
c:\\path\\to\\conda activate my_env
cd c:\\path\\to\\scripts
python myscript.py ${some_arg}
"""
...
Scripted pipeline:
...
bat(
returnStdout: true,
script: """
c:\\path\\to\\conda activate my_env
cd c:\\path\\to\\scripts
python myscript.py ${some_arg}
"""
)
...
What do I need to do to get all the lines to execute sequentially?
PS
I know I can chain the commands into a single line with "&" but that quickly becomes unreadable with lots of commands.