Skip to content

Commit 3bb61dc

Browse files
committed
Update Makefile to tmuxp's latest
1 parent a4f5406 commit 3bb61dc

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

Makefile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
WATCH_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]py$$' 2> /dev/null
2+
3+
14
test:
2-
py.test
5+
py.test $(test)
6+
7+
entr_warn:
8+
@echo "----------------------------------------------------------"
9+
@echo " ! File watching functionality non-operational ! "
10+
@echo ""
11+
@echo "Install entr(1) to automatically run tasks on file change."
12+
@echo "See http://entrproject.org/"
13+
@echo "----------------------------------------------------------"
14+
315

416
watch_test:
5-
if command -v entr > /dev/null; then find . -type f -not -path '*/\.*' | grep -i '.*[.]py' | entr -c make test; else make test; echo "\nInstall entr(1) to automatically run tests on file change.\n See http://entrproject.org/"; fi
17+
if command -v entr > /dev/null; then ${WATCH_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
618

719
build_docs:
820
cd doc && $(MAKE) html
@@ -14,6 +26,4 @@ flake8:
1426
flake8 libtmux tests
1527

1628
watch_flake8:
17-
if command -v entr > /dev/null; then find . -type f -not -path '*/\.*' | grep -i '.*[.][py]' | entr -c make flake8; else make flake8; echo "\nInstall entr(1) to automatically run tests on file change.\n See http://entrproject.org/"; fi
18-
19-
.PHONY: flake8
29+
if command -v entr > /dev/null; then ${WATCH_FILES} | entr -c $(MAKE) flake8; else $(MAKE) flake8 entr_warn; fi

doc/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ checkbuild:
156156
rm -rf $(BUILDDIR)
157157
$(SPHINXBUILD) -n -q ./ $(BUILDDIR)
158158

159+
WATCH_FILES= find .. -type f -not -path '*/\.*' | grep -i '.*[.]rst$$\|CHANGES\|TODO\|.*conf\.py$$' 2> /dev/null
160+
159161
watch:
160-
if command -v entr > /dev/null; then find .. -type f -not -path '*/\.*' | grep -i '.*[.]rst\|CHANGES\|TODO\|conf.py' | entr -c make html; else make html; echo "\nInstall entr(1) to automatically run tests on file change.\n See http://entrproject.org/"; fi
162+
if command -v entr > /dev/null; then ${WATCH_FILES} | entr -c $(MAKE) html; else $(MAKE) html; fi
161163

162164
serve:
163-
echo 'docs built to <http://0.0.0.0:8023/_build/html>'; python -m SimpleHTTPServer 8023
165+
echo 'docs built to <http://0.0.0.0:8023/_build/html>'; python -m SimpleHTTPServer 8003

0 commit comments

Comments
 (0)