Fix macOS 10.15 date test (#299)
- In macOS 10.15, the `date` command adds a "-R" flag. This can be seen in the default error display. Since the flags have changed, the grep command to find which version of macOS date binary we have. Because of this change, we need to do our own check for macOS 10.15. - Remove windows from the github actions as this tool is not for Windows, currently.
This commit is contained in:
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
platform: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -37,9 +37,9 @@ dist: $(DISTFILES) todo.sh
|
|||||||
cp -f $(DISTFILES) $(DISTNAME)/
|
cp -f $(DISTFILES) $(DISTNAME)/
|
||||||
sed -e 's/@DEV_VERSION@/'$(VERSION)'/' todo.sh > $(DISTNAME)/todo.sh
|
sed -e 's/@DEV_VERSION@/'$(VERSION)'/' todo.sh > $(DISTNAME)/todo.sh
|
||||||
chmod +x $(DISTNAME)/todo.sh
|
chmod +x $(DISTNAME)/todo.sh
|
||||||
tar cf $(DISTNAME).tar $(DISTNAME)/
|
tar cf $(DISTNAME).tar $(DISTNAME)
|
||||||
gzip -f -9 $(DISTNAME).tar
|
gzip -f -9 $(DISTNAME).tar
|
||||||
zip -9r $(DISTNAME).zip $(DISTNAME)/
|
tar cf $(DISTNAME).zip $(DISTNAME)
|
||||||
rm -r $(DISTNAME)
|
rm -r $(DISTNAME)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|||||||
@@ -495,11 +495,18 @@ 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 "-jnu"; then
|
||||||
DATE_STYLE=Mac10.5
|
DATE_STYLE=Mac10.5
|
||||||
# on Mac OS X 10.4:
|
# on Mac OS X 10.4:
|
||||||
@@ -519,6 +526,13 @@ 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
|
||||||
|
|||||||
Reference in New Issue
Block a user