Put default config file content directly into memory

This commit is contained in:
James M. Greene
2022-06-29 15:56:54 -05:00
parent c2d73e804d
commit 592edb0d53

View File

@@ -23,12 +23,11 @@ class ConfigParser {
validate() { validate() {
if (!this.config) { if (!this.config) {
// Create the config file if it doesn't exist core.info(`original raw configuration was invalid:\n${this.config}`)
fs.writeFile(this.staticSiteConfig.filePath, this.generateConfigFile(), (err) => { core.info(`Generating a default configuration to start from...`)
// In case of a error throw err. // Update the `config` property with a default configuration file
if (err) throw err; this.config = this.generateConfigFile()
})
} }
} }