joshfinnie / archey-osx

An archey script clone for OS X
MIT License
89 stars 14 forks source link

Yosemite support : 10.10 is not Puma #2

Closed ybart closed 10 years ago

ybart commented 10 years ago

Archey displays Puma instead of Yosemite in version information.

Version: OS X 10.10 Puma

joshfinnie commented 10 years ago

Thanks for the issue. Let me know if this fixes the issue @ybart!

ybart commented 10 years ago

@joshfinnie

Almost, the version number 10.10 is truncated to 10.1 before testing. This patch fixes the problem.

diff --git a/bin/archey b/bin/archey
index 533cc30..377aba8 100755
--- a/bin/archey
+++ b/bin/archey
@@ -12,8 +12,11 @@ version="OS X $(sw_vers -productVersion)"
 ## Version name
 versionNumber=$(sw_vers -productVersion) # Finds version number

-versionShort=${versionNumber:0:4}  # Cut sting to 1 decimal place for calculation
+versionMajor=`echo $versionNumber | cut -d'.' -f1`
+versionMinor=`echo $versionNumber | cut -d'.' -f2`
+versionShort="${versionMajor}.${versionMinor}" # Cut string to 1 decimal place for calculation

 case $versionShort in
     10.10)
         versionString="Yosemite"
joshfinnie commented 10 years ago

@ybart, good catch... I will update.