File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -474,18 +474,22 @@ For more information, see https://webpack.js.org/api/cli/.`);
474
474
const delimiter = outputOptions . buildDelimiter ? `${ outputOptions . buildDelimiter } \n` : "" ;
475
475
if ( statsString ) stdout . write ( `${ statsString } \n${ delimiter } ` ) ;
476
476
477
-
478
- const now = new Date ( ) ;
477
+ /**
478
+ * Show a hint to donate to our Opencollective
479
+ * once a week, only on Monday
480
+ */
481
+ const openCollectivePath = __dirname + "/opencollective.js" ;
479
482
const MONDAY = 1 ;
480
483
const SIX_DAYS = 518400000 ;
481
- const openCollectivePath = __dirname + "/opencollective.js" ;
484
+ const now = new Date ( ) ;
482
485
if ( now . getDay ( ) === MONDAY ) {
483
486
const { statSync, utimesSync } = require ( "fs" ) ;
484
487
const lastPrint = statSync ( openCollectivePath ) . atime ;
485
488
const lastPrintTS = new Date ( lastPrint ) . getTime ( ) ;
486
- if ( now . getTime ( ) - lastPrintTS > SIX_DAYS ) {
489
+ const timeSinceLastPrint = now . getTime ( ) - lastPrintTS ;
490
+ if ( timeSinceLastPrint > SIX_DAYS ) {
487
491
require ( openCollectivePath ) ;
488
- // On windows we need to update the atime
492
+ // On windows we need to manually update the atime
489
493
utimesSync ( openCollectivePath , now , now ) ;
490
494
}
491
495
}
You can’t perform that action at this time.
0 commit comments