Add support for macOS catalina date (#300)

Co-authored-by: Benoit Sagols <benoit.sagols@gmail.com>
This commit is contained in:
Ali Karbassi
2020-03-29 10:27:43 -05:00
committed by GitHub
parent 34d31ef45a
commit 13b451b81d

View File

@@ -495,19 +495,12 @@ test_init_todo () {
#... #...
if date --version 2>&1 | grep -q "GNU"; then if date --version 2>&1 | grep -q "GNU"; then
DATE_STYLE=GNU DATE_STYLE=GNU
# on Mac OS X 10.15:
#date --version
#date: illegal option -- -
#usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
# [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
elif date --version 2>&1 | grep -q -e "-jnRu"; then
DATE_STYLE=Mac10.15
# on Mac OS X 10.5: # on Mac OS X 10.5:
#date --version #date --version
#date: illegal option -- - #date: illegal option -- -
#usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... #usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
# [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] # [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
elif date --version 2>&1 | grep -q -e "-jnu"; then elif date --version 2>&1 | grep -q -e "-jnR\?u"; then
DATE_STYLE=Mac10.5 DATE_STYLE=Mac10.5
# on Mac OS X 10.4: # on Mac OS X 10.4:
#date --version #date --version
@@ -526,13 +519,6 @@ test_init_todo () {
EOF EOF
chmod 755 bin/date chmod 755 bin/date
;; ;;
Mac10.15)
cat > bin/date <<-EOF
#!/bin/sh
exec "$TODO_TEST_REAL_DATE" -j -f %s \$TODO_TEST_TIME \$@
EOF
chmod 755 bin/date
;;
Mac10.5) Mac10.5)
cat > bin/date <<-EOF cat > bin/date <<-EOF
#!/bin/sh #!/bin/sh