-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor script and check if enum content is number
- Loading branch information
1 parent
3c2b120
commit 656843e
Showing
5 changed files
with
198 additions
and
135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { AppFrontendVersion } from './version'; | ||
import { versionSettings } from './version'; | ||
import path from 'path'; | ||
import fs from 'fs'; | ||
|
||
export const writeToFile = (name: string, data: any, version: AppFrontendVersion) => { | ||
const dirPath = path.resolve(__dirname, versionSettings[version].componentSchemaPath); | ||
const fileName = `${dirPath}/${name}.schema.v1.json`; | ||
|
||
fs.writeFile(fileName, JSON.stringify(data), (err: any) => { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
console.log(`Wrote ${fileName}`); | ||
}); | ||
}; |
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
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