added more fallbacks

This commit is contained in:
Wyatt Johnson
2018-06-20 21:06:55 -06:00
parent ae9f5d4e8e
commit b6d2092048
+14 -1
View File
@@ -333,7 +333,20 @@ async function createSeedPlugin() {
try {
j = await fs.readJson(pluginsJson);
} catch (err) {
j = { client: [], server: [] };
// Fallback to plugins.default.json if the plugins.json file does not
// exist.
const defaultPluginsJson = path.resolve(
__dirname,
'..',
'plugins.default.json'
);
try {
j = await fs.readJson(defaultPluginsJson);
} catch (err) {
// Fallback to an empty one if that also, doesn't exist.
j = { client: [], server: [] };
}
}
// This is a client-side plugin, let's push this.