Moved scripts to own scripts folder

This commit is contained in:
2021-03-02 16:38:42 +01:00
parent dc3bab3247
commit 22195c11dd
2 changed files with 0 additions and 0 deletions

27
scripts/create_testenv.ts Normal file
View File

@@ -0,0 +1,27 @@
import consola from "consola";
import fs from "fs";
import nodemailer from "nodemailer";
nodemailer.createTestAccount((err, account) => {
if (err) {
console.error('Failed to create a testing account. ' + err.message);
return process.exit(1);
}
const env = `
NODE_ENV=dev
MAIL_SERVER=${account.smtp.host}
MAIL_PORT=${account.smtp.port}
MAIL_USER=${account.user}
MAIL_PASSWORD=${account.pass}
MAIL_FROM=${account.user}`
try {
fs.writeFileSync("./.env", env, { encoding: "utf-8" });
consola.success("Exported ci env to .env");
} catch (error) {
consola.error("Couldn't export the ci env");
}
});