summaryrefslogtreecommitdiff
path: root/src/org/stsci/OSInfo.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/stsci/OSInfo.groovy')
-rw-r--r--src/org/stsci/OSInfo.groovy17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/org/stsci/OSInfo.groovy b/src/org/stsci/OSInfo.groovy
new file mode 100644
index 0000000..cc1ddca
--- /dev/null
+++ b/src/org/stsci/OSInfo.groovy
@@ -0,0 +1,17 @@
+class OSInfo {
+ public String name
+ public String version
+ public String arch
+
+ OSInfo () {
+ name = 'uname -s'.execute().text.trim()
+ if (name == 'Darwin') { name = 'MacOSX' }
+ arch = 'uname -p'.execute().text.trim()
+ if (arch.matches('^i.*86$')) { arch = 'x86' }
+
+ this.name = name
+ this.arch = arch
+ this.version = 'uname -r'.execute().text.trim()
+ }
+
+}