File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -50,21 +50,23 @@ export class TmpDir {
50
50
}
51
51
52
52
return this . tempDirectoryPromise
53
- . then ( it => path . join ( it , `temp -${ ( this . tmpFileCounter ++ ) . toString ( 16 ) } ${ suffix . startsWith ( "." ) ? suffix : `-${ suffix } ` } ` ) )
53
+ . then ( it => path . join ( it , `t- ${ process . pid . toString ( 16 ) } -${ ( this . tmpFileCounter ++ ) . toString ( 16 ) } ${ suffix . startsWith ( "." ) ? suffix : `-${ suffix } ` } ` ) )
54
54
}
55
55
56
56
cleanup ( ) : Promise < any > {
57
- if ( this . dir == null ) {
57
+ const dir = this . dir
58
+ if ( dir == null ) {
58
59
return BluebirdPromise . resolve ( )
59
60
}
60
61
61
- return remove ( this . dir )
62
- . then ( ( ) => {
63
- this . dir = null
64
- } )
62
+ this . dir = null
63
+ return remove ( dir )
65
64
. catch ( e => {
66
- if ( e . code !== "EPERM" ) {
67
- warn ( `Cannot delete temporary dir "${ this . dir } ": ${ ( e . stack || e ) . toString ( ) } ` )
65
+ if ( e . code === "EPERM" ) {
66
+ this . dir = dir
67
+ }
68
+ else {
69
+ warn ( `Cannot delete temporary dir "${ dir } ": ${ ( e . stack || e ) . toString ( ) } ` )
68
70
}
69
71
} )
70
72
}
You can’t perform that action at this time.
0 commit comments