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() {
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()
}
}