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

View file

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

View file

@ -53,7 +53,7 @@ describe("packages", function() {
packages.loadPackages(); packages.loadPackages();
expect(stdout).to.deep.equal( 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"
); );
}); });
}); });