(tokens) add JS generator and re-organize the repo

Added JsGenerator which to implied to reorganize a bit the
repo in order to extract generator-specific test into specific
standalone files.
This commit is contained in:
Nathan Vasse
2022-12-30 17:45:35 +01:00
committed by NathanVss
parent 3e98429d04
commit 2876d29025
12 changed files with 188 additions and 70 deletions

View File

@@ -0,0 +1,14 @@
import fs from "fs";
import chalk from "chalk";
export const put = (path: string, content: string) => {
console.log("Generating tokens file to " + path + " ...");
const dir = path.substring(0, path.lastIndexOf("/"));
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
fs.writeFileSync(path, content);
console.log(
chalk.bgGreen(chalk.white("File " + path + " generated successfully."))
);
};