Merge pull request #3498 from MiniDigger/feature/package-versions

Print package versions on startup
This commit is contained in:
Pavel Djundik 2019-11-07 11:32:43 +02:00 committed by GitHub
commit 8a224809dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"
);
});
});