updated README

This commit is contained in:
Kai Ritthaler 2025-05-15 18:02:52 +02:00 committed by Rudi Regentonne
parent aa3f86d05b
commit 148e44a705
4 changed files with 73 additions and 29 deletions

View file

@ -27,6 +27,7 @@ while (!postgresPassword) {
});
!postgresPassword && console.log("Password cannot be empty");
}
// getting user input for .env file
const jwtSecret: string = crypto.randomBytes(32).toString("hex"); // 64 Zeichen
const env: string = `DATABASE_URL="postgresql://${postgresUser}:${postgresPassword}@localhost:5432/prisma"
TOKEN_SECRET="${jwtSecret}"
@ -38,13 +39,14 @@ try {
} catch (err) {
console.error("Error writing to file:", err);
}
// running the commands from the JSON file
// The commands are executed in the order they are defined in the JSON file
(async () => {
for (const command of config.commands) {
try {
const { stdout, stderr } = await execPromise(command); // Wait for the command to finish
if (stderr) {
console.log(`stderr: ${stderr}`);
console.log(stderr);
}
console.log(stdout); // Print the output of the command`);
} catch (error: any) {
@ -56,8 +58,6 @@ try {
fs.writeFile(json_path, JSON.stringify(config), (err) => {
if (err) {
console.error("Error writing to file:", err);
} else {
console.log("File has been updated successfully.");
}
});
console.log("Installation complete");