Skip to content

Commit

Permalink
Put default config file content directly into memory
Browse files Browse the repository at this point in the history
  • Loading branch information
James M. Greene authored and James M. Greene committed Jun 29, 2022
1 parent c2d73e8 commit 592edb0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/config-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 592edb0

Please sign in to comment.