Merge pull request #3279 from thelounge/xpaw/plugin-info

Add a message about experimental API
This commit is contained in:
Pavel Djundik 2019-07-05 11:51:46 +03:00 committed by GitHub
commit 2ce93e82c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -46,6 +46,7 @@ function getPackage(name) {
function loadPackages(clientManager) {
const packageJson = path.join(Helper.getPackagesPath(), "package.json");
let packages;
let anyPlugins = false;
try {
packages = Object.keys(require(packageJson).dependencies);
@ -77,6 +78,8 @@ function loadPackages(clientManager) {
if (packageInfo.type === "theme") {
themes.addTheme(packageName, packageInfo);
} else {
anyPlugins = true;
}
if (packageFile.onServerStart) {
@ -85,4 +88,8 @@ function loadPackages(clientManager) {
log.info(`Package ${colors.bold(packageName)} loaded`);
});
if (anyPlugins) {
log.info("There are packages using the experimental plugin API. Be aware that this API is not yet stable and may change in future The Lounge releases.");
}
}

View File

@ -55,7 +55,7 @@ describe("packages", function() {
packages.loadPackages();
expect(stdout).to.deep.equal("Package thelounge-package-foo loaded\n");
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");
});
});
});