diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-08-27 11:24:03 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-08-27 11:24:03 +0100 |
| commit | 8f4f459f8cc34c89c40f67ab9f5f8c553547c881 (patch) | |
| tree | 802eb1c8836fce6391dcff198ddf31e2d222c7c2 /app/index.ts | |
| parent | ce7ec8a43d874fecec705cfc570fd864a905d1d2 (diff) | |
Fix build date to be constant for all renders
Diffstat (limited to 'app/index.ts')
| -rw-r--r-- | app/index.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/index.ts b/app/index.ts index f7a443d..2bccdc5 100644 --- a/app/index.ts +++ b/app/index.ts @@ -1,14 +1,13 @@ import dotenv from 'dotenv-defaults'; import { logger } from './logger.js'; import { buildPages } from './builder/build.js'; +import buildInfo from './config/info.js'; dotenv.config(); -const startDate = new Date(); - logger.info(''); -logger.info('panulat, a static site generator'); -logger.info(startDate.toString()); +logger.info(`panulat v${buildInfo.panulat.version}, a static site generator`); +logger.info(buildInfo.date); logger.info(''); logger.info(`Static directory: ${process.env.STATIC_DIR}`); logger.info(` Pages directory: ${process.env.PAGES_DIR}`); @@ -26,7 +25,7 @@ if (!success && errors == 0) { process.exit(1); } -const exitString = `Finished${errors > 0 ? `, with ${errors} errors` : ''}. Build took ${new Date().getTime() - startDate.getTime()}ms.`; +const exitString = `Finished${errors > 0 ? `, with ${errors} errors` : ''}. Build took ${new Date().getTime() - buildInfo.date.getTime()}ms.`; if (!success) { logger.error(exitString); |
