Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/build-art.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
*/

import { readFileSync, writeFileSync } from "fs";
import { join } from "path";
import { join, dirname } from "path";
import { fileURLToPath } from "url";
import { ANIMAL_ART } from "../server/art.ts";
import { ANIMALS, ANIMAL_COLOR } from "../server/engine.ts";
import { ART_META } from "../server/art-meta.ts";
import type { AnimalId } from "../server/engine.ts";

// Resolve paths relative to this script's directory
const SCRIPT_DIR = new URL(".", import.meta.url).pathname;
// Resolve paths relative to this script's directory.
// fileURLToPath gives a proper platform path; `new URL(...).pathname` returns
// "/C:/..." on Windows which breaks downstream join() calls.
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
const PROJECT_ROOT = join(SCRIPT_DIR, "..");
const SHELL_PATH = join(PROJECT_ROOT, "statusline", "pet-status.sh");

Expand Down
Loading