diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eeea980c..b8699865 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - platform: [ubuntu-latest, macos-latest, ubuntu-18.04] + platform: [ubuntu-latest, macos-latest, ubuntu-18.04, windows-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 73f74b61..1c3cf10b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ tests/trash\ directory.* done.txt report.txt todo.txt +todo.txt_cli-*.tar.gz +todo.txt_cli-*.zip diff --git a/Makefile b/Makefile index 58c1e697..0f89ec14 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,12 @@ INSTALL_DATA = $(INSTALL) -m 644 prefix = /usr/local +ifeq ($(OS), Windows_NT) + ZIP_PROGRAM=7z a -r +else + ZIP_PROGRAM=zip -r -9 +endif + # ifdef check allows the user to pass custom dirs # as per the README @@ -48,38 +54,38 @@ DISTFILES := todo.cfg todo_completion DISTNAME=todo.txt_cli-$(VERSION) dist: $(DISTFILES) todo.sh - mkdir -p $(DISTNAME) - cp -f $(DISTFILES) $(DISTNAME)/ - sed -e 's/@DEV_VERSION@/'$(VERSION)'/' todo.sh > $(DISTNAME)/todo.sh - chmod +x $(DISTNAME)/todo.sh - tar cf $(DISTNAME).tar $(DISTNAME) - gzip -f -9 $(DISTNAME).tar - zip -r -9 $(DISTNAME).zip $(DISTNAME) - rm -r $(DISTNAME) + mkdir -p "$(DISTNAME)" + cp -f $(DISTFILES) "$(DISTNAME)/" + sed -e 's/@DEV_VERSION@/'$(VERSION)'/' todo.sh > "$(DISTNAME)/todo.sh" + chmod +x "$(DISTNAME)/todo.sh" + tar cf $(DISTNAME).tar "$(DISTNAME)" + gzip -f -9 "$(DISTNAME).tar" + $(ZIP_PROGRAM) "$(DISTNAME).zip" "$(DISTNAME)" + rm -r "$(DISTNAME)" .PHONY: clean clean: test-pre-clean - rm -f $(DISTNAME).tar.gz $(DISTNAME).zip - rm VERSION-FILE + rm -f "$(DISTNAME).tar.gz" "$(DISTNAME).zip" + rm "VERSION-FILE" install: installdirs - $(INSTALL_PROGRAM) todo.sh $(DESTDIR)$(bindir)/todo.sh - $(INSTALL_DATA) todo_completion $(DESTDIR)$(datarootdir)/todo - [ -e $(DESTDIR)$(sysconfdir)/todo/config ] || \ - sed "s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" todo.cfg > $(DESTDIR)$(sysconfdir)/todo/config + $(INSTALL_PROGRAM) todo.sh "$(DESTDIR)$(bindir)/todo.sh" + $(INSTALL_DATA) todo_completion "$(DESTDIR)$(datarootdir)/todo" + [ -e "$(DESTDIR)$(sysconfdir)/todo/config" ] || \ + sed "s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" todo.cfg > "$(DESTDIR)$(sysconfdir)/todo/config" uninstall: - rm -f $(DESTDIR)$(bindir)/todo.sh - rm -f $(DESTDIR)$(datarootdir)/todo - rm -f $(DESTDIR)$(sysconfdir)/todo/config + rm -f "$(DESTDIR)$(bindir)/todo.sh" + rm -f "$(DESTDIR)$(datarootdir)/todo" + rm -f "$(DESTDIR)$(sysconfdir)/todo/config" - rmdir $(DESTDIR)$(datarootdir) - rmdir $(DESTDIR)$(sysconfdir)/todo + rmdir "$(DESTDIR)$(datarootdir)" + rmdir "$(DESTDIR)$(sysconfdir)/todo" installdirs: - mkdir -p $(DESTDIR)$(bindir) \ - $(DESTDIR)$(sysconfdir)/todo \ - $(DESTDIR)$(datarootdir) + mkdir -p "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(sysconfdir)/todo" \ + "$(DESTDIR)$(datarootdir)" # # Testing @@ -88,7 +94,7 @@ TESTS = $(wildcard tests/t[0-9][0-9][0-9][0-9]-*.sh) #TEST_OPTIONS=--verbose test-pre-clean: - rm -rf tests/test-results "tests/trash directory"* + rm -rf "tests/test-results" "tests/trash directory"* aggregate-results: $(TESTS) @@ -98,7 +104,7 @@ $(TESTS): test-pre-clean test: aggregate-results tests/aggregate-results.sh tests/test-results/t*-* rm -rf tests/test-results - + # Force tests to get run every time .PHONY: test test-pre-clean aggregate-results $(TESTS)