简体   繁体   中英

Jenkinsfile: How do I print a boolean?

I would like to do the following as debugging output in a Jenkinsfile:

echo fileExists("path/to/some/file")

This does, however, not work. fileExists returns a boolean, which can apparently not be implicitly cast to a string, and the echo command wants a string.

So what's the correct way to print a boolean?

echo "${fileExists("path/to/some/file")}"

or more generally

echo "${boolean_expression}"

works. Is this how you're supposed to do it?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM