From b6d20920481fa0542825ea37b16d5eac69f79a6c Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 20 Jun 2018 21:06:55 -0600 Subject: [PATCH] added more fallbacks --- bin/cli-plugins | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/cli-plugins b/bin/cli-plugins index 4a778cd48..dba17c506 100755 --- a/bin/cli-plugins +++ b/bin/cli-plugins @@ -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.