This repository was archived by the owner on Jul 18, 2018. It is now read-only.
File tree 2 files changed +15
-4
lines changed 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 3
3
const spawn = require ( 'child_process' ) . spawn
4
4
const notifier = require ( 'node-notifier' )
5
5
const getGruntTasks = require ( 'get-grunt-tasks' )
6
+ const fs = require ( 'fs' )
7
+ const path = require ( 'path' )
6
8
7
9
global . processes = { }
8
10
11
+ exports . hasFile = function ( p , cb ) {
12
+ fs . stat ( path . join ( p , 'gruntfile.js' ) , function ( err , stats ) {
13
+ if ( err ) return cb ( false )
14
+ return cb ( true )
15
+ } )
16
+ }
17
+
9
18
exports . getTasks = function ( ) {
10
19
return new Promise ( function ( resolve , reject ) {
11
20
let current = window . localStorage . getItem ( 'current' )
Original file line number Diff line number Diff line change @@ -105,11 +105,13 @@ void (function () {
105
105
if ( window . localStorage . getItem ( 'followFinder' ) === 'true' ) {
106
106
finderInterval = setInterval ( function ( ) {
107
107
currentPath ( function ( err , path ) {
108
- if ( ! err && window . localStorage . getItem ( 'current' ) !== path ) {
109
- window . localStorage . setItem ( 'current' , path )
108
+ grunt . hasFile ( path , function ( status ) {
109
+ if ( ! err && window . localStorage . getItem ( 'current' ) !== path && status ) {
110
+ window . localStorage . setItem ( 'current' , path )
110
111
111
- rebuild ( )
112
- }
112
+ rebuild ( )
113
+ }
114
+ } )
113
115
} )
114
116
} , FINDER_UPDATE )
115
117
}
You can’t perform that action at this time.
0 commit comments