scriptcs-contrib / svm

scriptcs version manager
Apache License 2.0
43 stars 13 forks source link

Version sorting errors on OSX #57

Closed paulbouwer closed 9 years ago

paulbouwer commented 9 years ago

Reported by Martin Öbrink-Hansen via twitter

hmm... svm (0.3.7) error on osx? ~$svm install latest Finding latest available version to install. sort: invalid option -- V

The -V option is not supported on OSX version of sort.

paulbouwer commented 9 years ago

Since there is a discrepancy between the versions of sort on Linux and OSX, the version sorting will be implemented via a modified version of the sed and sort script show in How to simulate “sort -V” on Mac OSX.

ls | sed 's/^[0-9]\./0&/; s/\.\([0-9]\)$/.0\1/; s/\.\([0-9]\)\./.0\1./g;' | sort -r | sed 's/^0// ; s/\.0/./g'
paulbouwer commented 9 years ago

Windows PowerShell version will be updated to have consistent sorting now with Linux and OSX bash versions.