File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -326,14 +326,21 @@ For more information, see https://webpack.js.org/api/cli/.`);
326326 const SIX_DAYS = 518400000 ;
327327 const now = new Date ( ) ;
328328 if ( now . getDay ( ) === MONDAY ) {
329- const { statSync, utimesSync } = require ( "fs" ) ;
329+ const {
330+ access,
331+ constants,
332+ statSync,
333+ utimesSync,
334+ } = require ( "fs" ) ;
330335 const lastPrint = statSync ( openCollectivePath ) . atime ;
331336 const lastPrintTS = new Date ( lastPrint ) . getTime ( ) ;
332337 const timeSinceLastPrint = now . getTime ( ) - lastPrintTS ;
333338 if ( timeSinceLastPrint > SIX_DAYS ) {
334339 require ( openCollectivePath ) ;
335340 // 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+ } ) ;
337344 }
338345 }
339346 }
You can’t perform that action at this time.
0 commit comments