File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function Pointer(obj) {
22
22
var name = path . basename ( obj . filePath ) ;
23
23
var ext = path . extname ( name ) ;
24
24
ext = ext . charAt ( 0 ) === '.' ? ext . substr ( 1 ) : '' ;
25
- var _path = path . resolve ( obj . filePath ) ;
25
+ var _path = path . resolve ( obj . filePath ) ;
26
26
27
27
Object . defineProperties ( self , {
28
28
// Pointer to parent if one exists
@@ -49,7 +49,7 @@ function Pointer(obj) {
49
49
// file or directory
50
50
_type : {
51
51
get : function ( ) { return type ; } ,
52
- set : function ( v ) { type = v ; } ,
52
+ set : function ( v ) { type = v ; } ,
53
53
configurable : true
54
54
} ,
55
55
// Cached stats
@@ -135,13 +135,16 @@ function Pointer(obj) {
135
135
value : function ( ) {
136
136
if ( watcher ) {
137
137
watcher . close ( ) ;
138
+ watcher = null ;
138
139
}
139
140
}
140
141
} ,
141
142
// Start watching file changes
142
143
__startWatch : {
143
144
value : function ( ) {
144
- forwardEvents ( fs . watch ( self . _path , { persistent : false } ) ) ;
145
+ if ( ! watcher ) {
146
+ forwardEvents ( fs . watch ( self . _path , { persistent : false } ) ) ;
147
+ }
145
148
}
146
149
}
147
150
} ) ;
Original file line number Diff line number Diff line change 7
7
" files" ,
8
8
" pointer"
9
9
],
10
- "version" : " 0.0.7 " ,
10
+ "version" : " 0.0.8 " ,
11
11
"repository" : {
12
12
"type" : " git" ,
13
13
"url" : " git@github.com:DeadAlready/node-file-pointer"
You can’t perform that action at this time.
0 commit comments