From 592edb0d531335e0476352094f370736ff3156ed Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Wed, 29 Jun 2022 15:56:54 -0500 Subject: [PATCH] Put default config file content directly into memory --- src/config-parser.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/config-parser.js b/src/config-parser.js index 4de4cfe..b5da032 100644 --- a/src/config-parser.js +++ b/src/config-parser.js @@ -23,12 +23,11 @@ class ConfigParser { validate() { if (!this.config) { - // Create the config file if it doesn't exist - fs.writeFile(this.staticSiteConfig.filePath, this.generateConfigFile(), (err) => { + core.info(`original raw configuration was invalid:\n${this.config}`) + core.info(`Generating a default configuration to start from...`) - // In case of a error throw err. - if (err) throw err; - }) + // Update the `config` property with a default configuration file + this.config = this.generateConfigFile() } }