make it start working again
Some checks failed
ci/woodpecker/cron/ci Pipeline failed

This commit is contained in:
Madison Grubb
2025-12-11 23:13:07 -05:00
parent dc9ec367a0
commit 96480a351f
10 changed files with 1054 additions and 439 deletions

View File

@@ -1,18 +1,25 @@
import 'dotenv/config';
import "dotenv/config";
import { generateDungeon } from "./dungeonGenerator.js";
import { generateDungeonImages } from "./imageGenerator.js";
import { generatePDF } from "./generatePDF.js";
import { DEFAULT_OLLAMA_MODEL } from "./ollamaClient.js";
// Utility to create a filesystem-safe filename from the dungeon title
function slugify(text) {
return text
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-') // replace non-alphanumeric with hyphens
.replace(/^-+|-+$/g, ''); // trim leading/trailing hyphens
.replace(/[^a-z0-9]+/g, "-") // replace non-alphanumeric with hyphens
.replace(/^-+|-+$/g, ""); // trim leading/trailing hyphens
}
(async () => {
try {
if (!process.env.OLLAMA_API_URL) {
throw new Error("OLLAMA_API_URL environment variable is required");
}
console.log("Using Ollama API URL:", process.env.OLLAMA_API_URL);
console.log("Using Ollama model:", DEFAULT_OLLAMA_MODEL);
// Generate the dungeon data
const dungeonData = await generateDungeon();
@@ -30,5 +37,6 @@ function slugify(text) {
console.log(`Dungeon PDF successfully generated: ${filename}`);
} catch (err) {
console.error("Error generating dungeon:", err);
process.exit(1);
}
})();