Handle error where BSD date is being used #164
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users on macOS and other older distributions of Linux and Unix cannot fully utilize this application as a handful of date/time strings in here are specific to the GNU utility found on most modern version of Linux.
Until every date/time case is handled between the BSD version of date and the GNU version of date, let's error out akin to how we do it if the user doesn't have every utility installed to run this script.
Users can get around this by using package managers on macOS such as homebrew, macports, etc and making sure that 'date' points to the GNU version of date instead of the BSD version. Linux and Unix users can get around this by installing the GNU version of date, as well.
Removed checking OSTYPE in the format_date() function as checking if someone is on a machine that identifies as Darwin is not enough to handle other edge cases where an older version of BSD date might be present on the system.
Important: While this does not close tickets like #160 and #163 (these two tickets should be combined as it's the same bug), it should hopefully prevent further tickets from being created and avoid overall confusion as to what's going on.