superman thinks that I have no free space, but I have ~350GB free
I found that this in line 4495
[[ "${current_user_account_name}" != "FALSE" ]] && storage_available_gigabytes=$(osascript -l 'JavaScript' -e "ObjC.import('Foundation'); var freeSpaceBytesRef=Ref(); $.NSURL.fileURLWithPath('/').getResourceValueForKeyError(freeSpaceBytesRef, 'NSURLVolumeAvailableCapacityForImportantUsageKey', null); Math.round(ObjC.unwrap(freeSpaceBytesRef[0]) / 1000000000)")
suddenly returns 0 on my system
but
[[ "${current_user_account_name}" != "FALSE" ]] && storage_available_gigabytes=$(osascript -l 'JavaScript' -e "ObjC.import('Foundation'); var freeSpaceBytesRef=Ref(); $.NSURL.fileURLWithPath('/').getResourceValueForKeyError(freeSpaceBytesRef, 'NSURLVolumeAvailableCapacityKey', null); Math.round(ObjC.unwrap(freeSpaceBytesRef[0]) / 1000000000)")
returns 359 (which is correct)
Well thank you for pin-pointing the specific API call! We should do some sleuthing in the Apple Dev documentation to see if there is a "more correct" call?
Full disclosure, I coppied that specific line from another script... so I (currently) don't have a strong opinion one way or the other.
I didn't even know this command existed. I normally just use df but I guess this is more accurate?