fix(schematics): don't leak file descriptor in shared.ts/mtime
leak breaks IDE-TSLint integration. Fixes #403
This commit is contained in:
parent
8ca8548886
commit
aa1ff78c0e
@ -234,7 +234,12 @@ function recursiveMtime(dirName: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mtime(f: string): number {
|
function mtime(f: string): number {
|
||||||
return fs.fstatSync(fs.openSync(f, 'r')).mtime.getTime();
|
let fd = fs.openSync(f, 'r');
|
||||||
|
try {
|
||||||
|
return fs.fstatSync(fd).mtime.getTime();
|
||||||
|
} finally {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizePath(file: string): string {
|
function normalizePath(file: string): string {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user