Print package versions on startup

This commit is contained in:
MiniDigger 2019-11-06 17:16:40 +01:00
parent 064d36a6cc
commit 6f8364b1dd
3 changed files with 5 additions and 2 deletions

View file

@ -97,8 +97,10 @@ function loadPackages() {
return;
}
const version = packageInfo.version;
packageInfo = packageInfo.thelounge;
packageInfo.packageName = packageName;
packageInfo.version = version;
packageMap.set(packageName, packageFile);
@ -116,7 +118,7 @@ function loadPackages() {
packageFile.onServerStart(packageApis(packageInfo));
}
log.info(`Package ${colors.bold(packageName)} loaded`);
log.info(`Package ${colors.bold(packageName)} ${colors.green("v" + version)} loaded`);
});
if (anyPlugins) {

View file

@ -2,6 +2,7 @@
"name": "thelounge-package-foo",
"private": true,
"main": "index.js",
"version": "dummy",
"thelounge": {
"type": "package"
},

View file

@ -53,7 +53,7 @@ describe("packages", function() {
packages.loadPackages();
expect(stdout).to.deep.equal(
"Package thelounge-package-foo loaded\nThere are packages using the experimental plugin API. Be aware that this API is not yet stable and may change in future The Lounge releases.\n"
"Package thelounge-package-foo vdummy loaded\nThere are packages using the experimental plugin API. Be aware that this API is not yet stable and may change in future The Lounge releases.\n"
);
});
});