@@ -13,6 +13,11 @@ const classes = {
1313 merge_request : MergeRequest
1414} ;
1515
16+ const stop_condition = {
17+ term : `"stop" ?: ?false` ,
18+ flags : "i"
19+ } ;
20+
1621class tasks {
1722 constructor ( config ) {
1823 this . config = config ;
@@ -138,7 +143,7 @@ class tasks {
138143 */
139144 status ( ) {
140145 return new Promise ( ( resolve , reject ) => {
141- Fs . find ( `"stop": false` , this . config . frameDir )
146+ Fs . find ( stop_condition , this . config . frameDir )
142147 . then ( frames => resolve ( frames . map ( file => Frame . fromFile ( this . config , file ) ) ) )
143148 . catch ( error => reject ( error ) ) ;
144149 } ) ;
@@ -196,6 +201,11 @@ class tasks {
196201 } ) ;
197202 }
198203
204+ list ( project , state , my ) {
205+ this . config . set ( 'project' , project ) ;
206+ return ( new classes [ 'issue' ] ( this . config , { } ) ) . list ( this . config . get ( 'project' ) , state , my ) ;
207+ }
208+
199209 /**
200210 *
201211 * @param project
@@ -207,7 +217,7 @@ class tasks {
207217 this . config . set ( 'project' , project ) ;
208218
209219 return new Promise ( ( resolve , reject ) => {
210- Fs . find ( `"stop": false` , this . config . frameDir )
220+ Fs . find ( stop_condition , this . config . frameDir )
211221 . then ( frames => {
212222 if ( frames . length > 0 )
213223 return reject ( "Already running. Please stop it first with 'gtt stop'." ) ;
@@ -224,7 +234,7 @@ class tasks {
224234 */
225235 stop ( ) {
226236 return new Promise ( ( resolve , reject ) => {
227- Fs . find ( `"stop": false` , this . config . frameDir )
237+ Fs . find ( stop_condition , this . config . frameDir )
228238 . then ( frames => {
229239 if ( frames . length === 0 )
230240 return reject ( 'No projects started.' ) ;
@@ -243,7 +253,7 @@ class tasks {
243253 */
244254 cancel ( ) {
245255 return new Promise ( ( resolve , reject ) => {
246- Fs . find ( `"stop": false` , this . config . frameDir )
256+ Fs . find ( stop_condition , this . config . frameDir )
247257 . then ( frames => {
248258 if ( frames . length === 0 )
249259 return reject ( 'No projects started.' ) ;
@@ -260,4 +270,4 @@ class tasks {
260270 }
261271}
262272
263- module . exports = tasks ;
273+ module . exports = tasks ;
0 commit comments