mirror of
https://github.com/wassname/talk.git
synced 2026-07-21 12:51:03 +08:00
Merge pull request #1434 from evgenykireev/fixing-plugins-env-js
do not use hjson for plugins.env.js
This commit is contained in:
+2
-1
@@ -1 +1,2 @@
|
|||||||
module.exports = JSON.parse(process.env.TALK_PLUGINS_JSON);
|
const hjson = require('hjson');
|
||||||
|
module.exports = hjson.parse(process.env.TALK_PLUGINS_JSON);
|
||||||
|
|||||||
+12
-9
@@ -26,17 +26,20 @@ try {
|
|||||||
if (PLUGINS_JSON && PLUGINS_JSON.length > 0) {
|
if (PLUGINS_JSON && PLUGINS_JSON.length > 0) {
|
||||||
debug('Now using TALK_PLUGINS_JSON environment variable for plugins');
|
debug('Now using TALK_PLUGINS_JSON environment variable for plugins');
|
||||||
pluginsPath = envPlugins;
|
pluginsPath = envPlugins;
|
||||||
} else if (fs.existsSync(customPlugins)) {
|
plugins = require(pluginsPath);
|
||||||
debug(`Now using ${customPlugins} for plugins`);
|
|
||||||
pluginsPath = customPlugins;
|
|
||||||
} else {
|
} else {
|
||||||
debug(`Now using ${defaultPlugins} for plugins`);
|
if (fs.existsSync(customPlugins)) {
|
||||||
pluginsPath = defaultPlugins;
|
debug(`Now using ${customPlugins} for plugins`);
|
||||||
}
|
pluginsPath = customPlugins;
|
||||||
|
} else {
|
||||||
|
debug(`Now using ${defaultPlugins} for plugins`);
|
||||||
|
pluginsPath = defaultPlugins;
|
||||||
|
}
|
||||||
|
|
||||||
// Load/parse the plugin content using hjson.
|
// Load/parse the plugin content using hjson.
|
||||||
const pluginContent = fs.readFileSync(pluginsPath, 'utf8');
|
const pluginContent = fs.readFileSync(pluginsPath, 'utf8');
|
||||||
plugins = hjson.parse(pluginContent);
|
plugins = hjson.parse(pluginContent);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
console.error(
|
console.error(
|
||||||
|
|||||||
Reference in New Issue
Block a user