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/.`);
474474 const delimiter = outputOptions . buildDelimiter ? `${ outputOptions . buildDelimiter } \n` : "" ;
475475 if ( statsString ) stdout . write ( `${ statsString } \n${ delimiter } ` ) ;
476476
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" ;
479482 const MONDAY = 1 ;
480483 const SIX_DAYS = 518400000 ;
481- const openCollectivePath = __dirname + "/opencollective.js" ;
484+ const now = new Date ( ) ;
482485 if ( now . getDay ( ) === MONDAY ) {
483486 const { statSync, utimesSync } = require ( "fs" ) ;
484487 const lastPrint = statSync ( openCollectivePath ) . atime ;
485488 const lastPrintTS = new Date ( lastPrint ) . getTime ( ) ;
486- if ( now . getTime ( ) - lastPrintTS > SIX_DAYS ) {
489+ const timeSinceLastPrint = now . getTime ( ) - lastPrintTS ;
490+ if ( timeSinceLastPrint > SIX_DAYS ) {
487491 require ( openCollectivePath ) ;
488- // On windows we need to update the atime
492+ // On windows we need to manually update the atime
489493 utimesSync ( openCollectivePath , now , now ) ;
490494 }
491495 }
You can’t perform that action at this time.
0 commit comments