-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31a4dee
commit 239ecb8
Showing
4 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// there are issues with running prettier as a CLI command | ||
// see: https://github.com/ScottLogic/openapi-forge/issues/133 | ||
// this is a workaround to run the prettier CLI as a node module | ||
const cli = require("prettier/cli.js"); | ||
|
||
// map forge log levels to prettier log levels | ||
const logLevels = [ | ||
/* quiet */ | ||
"silent", | ||
/* standard */ | ||
"warn", | ||
/* verbose */ | ||
"debug", | ||
]; | ||
|
||
module.exports = (folder, logLevel) => { | ||
cli.run(["--write", folder, "--loglevel", logLevels[logLevel]]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{{#if models}} | ||
{{#if models }} | ||
const { | ||
{{#each models}}{{@key}}, {{/each}} | ||
} = require("./model"); | ||
|