make dependencies.d.ts a txt file

This commit is contained in:
Jacob Nguyen
2023-06-10 09:44:00 -05:00
parent e94a2be41f
commit 28f9390865
6 changed files with 18 additions and 42 deletions

View File

@@ -73,11 +73,11 @@ async function runInteractive() {
};
console.log(greenBright(`overwrite: ${argv.overwrite ?? false};\ncopy: ${selectedTemplate} ${root}`));
await copyFolderRecursiveAsync(selectedTemplate , root);
console.log(greenBright('Writing sern.config.json to '+ result.name + "/sern.config.json"));
await fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8');
console.log(greenBright('Writing dependencies.d.ts to '+ name));
await Promise.all([
fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8'),
fs.promises.writeFile(path.join(root, 'src', 'dependencies.d.ts'), await fs.promises.readFile(path.join(cwd, 'dependencies.d.txt')), 'utf8')
]);
console.log(greenBright('Done! visit https://sern.dev for documentation and join https://sern.dev/discord! Happy hacking :)' ));
}
@@ -107,9 +107,12 @@ async function runShort(templateName: string, name:string) {
console.log(greenBright(`overwrite: ${argv.overwrite ?? false};\ncopy: ${selectedTemplate} ${root}`));
await copyFolderRecursiveAsync(selectedTemplate , root);
console.log(greenBright('Writing sern.config.json to '+ name + "/sern.config.json"));
await fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8');
console.log(greenBright('Writing dependencies.d.ts to '+ name));
await Promise.all([
fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8'),
fs.promises.writeFile(path.join(root, 'src', 'dependencies.d.ts'), await fs.promises.readFile(path.join(cwd, 'dependencies.d.txt')), 'utf8')
]);
console.log(greenBright('Done! visit https://sern.dev for documentation and join https://sern.dev/discord! Happy hacking :)' ));
}
async function init() {