Created
May 7, 2013 19:48
-
-
Save tamirko/5535555 to your computer and use it in GitHub Desktop.
OS detection
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
def os = OperatingSystem.getInstance() | |
def currVendor=os.getVendor() | |
switch (currVendor) { | |
case ["Ubuntu", "Debian", "Mint"]: | |
//Do Something #1 | |
break | |
case ["Red Hat", "CentOS", "Fedora", "Amazon",""]: | |
//Do Something #2 | |
break | |
case ~/.*(?i)(Microsoft|Windows).*/: | |
//Do Something #2 | |
break | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment