File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -342,14 +342,17 @@ For more information, see https://webpack.js.org/api/cli/.`);
342342 const now = new Date ( ) ;
343343 if ( now . getDay ( ) === MONDAY ) {
344344 const { access, constants, statSync, utimesSync } = require ( "fs" ) ;
345- const lastPrint = statSync ( openCollectivePath ) . atime ;
345+ const stat = statSync ( openCollectivePath ) ;
346+ const lastPrint = stat . atime ;
347+ const fileOwnerId = stat . uid ;
346348 const lastPrintTS = new Date ( lastPrint ) . getTime ( ) ;
347349 const timeSinceLastPrint = now . getTime ( ) - lastPrintTS ;
348350 if ( timeSinceLastPrint > SIX_DAYS ) {
349351 require ( openCollectivePath ) ;
350352 // On windows we need to manually update the atime
353+ // Updating utime requires process owner is as same as file owner
351354 access ( openCollectivePath , constants . W_OK , e => {
352- if ( ! e ) utimesSync ( openCollectivePath , now , now ) ;
355+ if ( ! e && fileOwnerId === process . getuid ( ) ) utimesSync ( openCollectivePath , now , now ) ;
353356 } ) ;
354357 }
355358 }
You can’t perform that action at this time.
0 commit comments