@@ -2,6 +2,7 @@ import path from "node:path";
2
2
import fs from "graceful-fs" ;
3
3
import yaml from "js-yaml" ;
4
4
import kleur from "kleur" ;
5
+ import { createRequire } from "node:module" ;
5
6
6
7
import { Logger } from "./Logger.js" ;
7
8
import { Fetcher } from "./Fetcher.js" ;
@@ -18,6 +19,11 @@ import { WordPressApi } from "./DataSource/WordPressApi.js";
18
19
import { BlueskyUser } from "./DataSource/BlueskyUser.js" ;
19
20
import { FediverseUser } from "./DataSource/FediverseUser.js" ;
20
21
22
+
23
+ const require = createRequire ( import . meta. url ) ;
24
+
25
+ let pkg = require ( "../package.json" ) ;
26
+
21
27
// For testing
22
28
const MAX_IMPORT_SIZE = 0 ;
23
29
@@ -345,21 +351,22 @@ ${entry.content}`
345
351
logResults ( ) {
346
352
let counts = this . getCounts ( ) ;
347
353
let sourcesDisplay = this . getSources ( ) . map ( source => source . constructor . TYPE_FRIENDLY || source . constructor . TYPE ) . join ( ", " ) ;
348
-
349
354
let content = [ ] ;
350
355
content . push ( kleur . green ( "Wrote" ) ) ;
351
- content . push ( kleur . green ( Logger . plural ( counts . files , "document" ) ) ) ;
356
+ content . push ( kleur . green ( ` ${ counts . files } ${ Logger . plural ( counts . files , "document" ) } ` ) ) ;
352
357
content . push ( kleur . green ( "and" ) ) ;
353
- content . push ( kleur . green ( Logger . plural ( counts . assets - counts . cleaned , "asset" ) ) ) ;
358
+ content . push ( kleur . green ( ` ${ counts . assets - counts . cleaned } ${ Logger . plural ( counts . assets - counts . cleaned , "asset" ) } ` ) ) ;
354
359
if ( counts . cleaned ) {
355
360
content . push ( kleur . gray ( `(${ counts . cleaned } cleaned, unused)` ) ) ;
356
361
}
357
362
content . push ( kleur . green ( `from ${ sourcesDisplay } ` ) ) ;
358
- content . push ( kleur [ counts . errors > 0 ? "red" : "gray" ] ( `(${ Logger . plural ( counts . errors , "error" ) } )` ) ) ;
363
+ content . push ( kleur [ counts . errors > 0 ? "red" : "gray" ] ( `(${ counts . errors } ${ Logger . plural ( counts . errors , "error" ) } )` ) ) ;
359
364
if ( this . startTime ) {
360
365
content . push ( `in ${ Logger . time ( Date . now ( ) - this . startTime ) } ` ) ;
361
366
}
362
367
368
+ content . push ( `(v${ pkg . version } )` ) ;
369
+
363
370
Logger . log ( content . join ( " " ) ) ;
364
371
}
365
372
}
0 commit comments