Created
October 3, 2016 17:22
-
-
Save foragerr/4167b553d5bb165be52528561d0c1c39 to your computer and use it in GitHub Desktop.
Check if env variable is set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task sysPropCheck << { | |
if (System.getenv('sysproptest')) | |
println 'sysproptest is set to ' + System.getenv('sysproptest') | |
else | |
println 'set sysproptest first!' | |
} | |
//Output: | |
// $ gradle -q sysPropCheck | |
// set sysproptest first! | |
// $ export sysproptest=FOO | |
// $ gradle -q sysPropCheck | |
// sysproptest is set to FOO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment