File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -326,14 +326,21 @@ For more information, see https://webpack.js.org/api/cli/.`);
326
326
const SIX_DAYS = 518400000 ;
327
327
const now = new Date ( ) ;
328
328
if ( now . getDay ( ) === MONDAY ) {
329
- const { statSync, utimesSync } = require ( "fs" ) ;
329
+ const {
330
+ access,
331
+ constants,
332
+ statSync,
333
+ utimesSync,
334
+ } = require ( "fs" ) ;
330
335
const lastPrint = statSync ( openCollectivePath ) . atime ;
331
336
const lastPrintTS = new Date ( lastPrint ) . getTime ( ) ;
332
337
const timeSinceLastPrint = now . getTime ( ) - lastPrintTS ;
333
338
if ( timeSinceLastPrint > SIX_DAYS ) {
334
339
require ( openCollectivePath ) ;
335
340
// On windows we need to manually update the atime
336
- utimesSync ( openCollectivePath , now , now ) ;
341
+ access ( openCollectivePath , constants . W_OK , ( e ) => {
342
+ if ( ! e ) utimesSync ( openCollectivePath , now , now ) ;
343
+ } ) ;
337
344
}
338
345
}
339
346
}
You can’t perform that action at this time.
0 commit comments