add version unit

copy from https://gist.github.com/dkstar88/6129669
Trim remove MacOS system
remove MacOS