File tree 1 file changed +5
-2
lines changed
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/.`);
342
342
const now = new Date ( ) ;
343
343
if ( now . getDay ( ) === MONDAY ) {
344
344
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 ;
346
348
const lastPrintTS = new Date ( lastPrint ) . getTime ( ) ;
347
349
const timeSinceLastPrint = now . getTime ( ) - lastPrintTS ;
348
350
if ( timeSinceLastPrint > SIX_DAYS ) {
349
351
require ( openCollectivePath ) ;
350
352
// On windows we need to manually update the atime
353
+ // Updating utime requires process owner is as same as file owner
351
354
access ( openCollectivePath , constants . W_OK , e => {
352
- if ( ! e ) utimesSync ( openCollectivePath , now , now ) ;
355
+ if ( ! e && fileOwnerId === process . getuid ( ) ) utimesSync ( openCollectivePath , now , now ) ;
Has conversations. Original line has conversations. 353
356
} ) ;
354
357
}
355
358
}
You can’t perform that action at this time.