File tree 4 files changed +670
-19
lines changed
4 files changed +670
-19
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
sudo : false
3
3
node_js :
4
- - 6
4
+ - 12
5
+ - 11
6
+ - 10
7
+ - 8
5
8
before_script :
6
9
- npm install -g grunt-cli
Original file line number Diff line number Diff line change 13
13
14
14
var path = require ( 'path' ) ;
15
15
var cmd = require ( 'commander' ) ;
16
+ var nodemon = require ( 'nodemon' ) ;
16
17
var apidoc = require ( '../lib/index' ) ;
17
18
18
19
var argv = cmd
@@ -57,6 +58,8 @@ var argv = cmd
57
58
58
59
. option ( '--filter-by <tag-filter=value>' , 'Filter documentation by tag' )
59
60
61
+ . option ( '--watch' , 'Watch the Input/Source dirname for changes to rebuild the docs' )
62
+
60
63
. parse ( process . argv )
61
64
;
62
65
@@ -120,6 +123,19 @@ var options = {
120
123
filterBy : argv . filterBy ,
121
124
} ;
122
125
126
+ if ( argv . watch ) {
127
+ nodemon ( { watch : options . src } ) ;
128
+ console . log ( 'Watching mode is Activated\nListening for changes...' ) ;
129
+ nodemon . on ( 'quit' , function ( ) {
130
+ console . log ( 'ApiDoc has exited' ) ;
131
+ process . exit ( )
132
+ } ) . on ( 'restart' , function ( ) {
133
+ console . log ( 'Changes detected, Rebuilding the docs...' ) ;
134
+ apidoc . createDoc ( options ) ;
135
+ console . log ( 'Listening for changes...' ) ;
136
+ } ) ;
137
+ }
138
+
123
139
if ( apidoc . createDoc ( options ) === false ) {
124
140
process . exit ( 1 ) ;
125
141
}
You can’t perform that action at this time.
0 commit comments