Browse Source

added watch task to Makefile

Inderjit Gill 7 years ago
parent
commit
c2ca9b9e2a
2 changed files with 17 additions and 1 deletions
  1. 12
    1
      Makefile
  2. 5
    0
      aux/watching.rb

+ 12
- 1
Makefile View File

@@ -1,5 +1,6 @@
1 1
 EXPRESSO ?= `which expresso`
2 2
 DOCCO ?= `which docco`
3
+WATCHR ?= `which watchr`
3 4
 
4 5
 test:
5 6
 	@@if test ! -z ${EXPRESSO}; then \
@@ -18,4 +19,14 @@ docs:
18 19
 		echo "You can install it by running: npm install docco -g"; \
19 20
 	fi
20 21
 
21
-.PHONY: test docs
22
+watch:
23
+	@@if test ! -z ${WATCHR}; then \
24
+	  echo "Watching lib and test folders..."; \
25
+	  watchr aux/watching.rb; \
26
+	else \
27
+		echo "You must have the watchr installed in order to watch Full Meta Jacket."; \
28
+		echo "You can install it by running: gem install watchr"; \
29
+	fi
30
+
31
+
32
+.PHONY: test docs watch

+ 5
- 0
aux/watching.rb View File

@@ -0,0 +1,5 @@
1
+require 'watchr'
2
+
3
+watch('test/(.*)\.js') {|t| system "make test"}
4
+watch('lib/(.*)\.js')  {|t| system "make test"}
5
+