JayBrown / Checksums

macOS workflow and shell script to calculate or automatically verify checksums for files or folder contents
MIT License
42 stars 9 forks source link

Does not work in macos big sur #4

Open joobei opened 3 years ago

joobei commented 3 years ago

Error message says that it only support macos 10.8+

sth0 commented 2 years ago

Yes, since it is comparing 11.X to 10.8 by comparing X to 8 and X is 6 or less. the same is true for Monterey where it is comparing 12.2 to 10.8 by comparing 2 to 8.

If the function using the bc command is defined: ifbc () { test $(echo "$@" | bc -l ) -ne 0; }

Then the test could be changed to ifbc "sw_vers -productVersion | cut -d. -f1,2 > 10.8" && echo "true, it's greater" || echo "no, it's less or ="

sth0 commented 2 years ago

If the version test code at the point of the "# check compatibility" comment is replaced by the following it should work.

# use bc as numerical decimal test
ifbc () { test $(echo "$@" | bc -l ) -ne 0; }

# check compatibility
# get version in XX.YY form
MACOS2NO=$(/usr/bin/sw_vers -productVersion | cut -d. -f1,2)
if ( ifbc "$MACOS2NO < 10.8" ) ; then