fix: jsr install breaks because of missing asciiart file

This commit is contained in:
Emmaline Autumn 2025-05-20 15:13:36 -06:00
parent cdeef54f68
commit 001b90744b
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@bearmetal/pdf-tools", "name": "@bearmetal/pdf-tools",
"version": "1.0.2", "version": "1.0.3",
"license": "GPL 3.0", "license": "GPL 3.0",
"tasks": { "tasks": {
"dev": "deno run -A --env-file=.env main.ts", "dev": "deno run -A --env-file=.env main.ts",

View File

@ -3,8 +3,10 @@ import { join } from "@std/path";
export async function getAsciiArt(art: string) { export async function getAsciiArt(art: string) {
try { try {
const artFilePath = Deno.env.get("BEARMETAL_ASCII_PATH") || const artFilePath =
join(import.meta.dirname || "", "../asciiart.txt"); Deno.env.get("BEARMETAL_ASCII_PATH") || import.meta.dirname
? join(import.meta.dirname || "", "../asciiart.txt")
: "https://git.cyborggrizzly.com/BearMetal/pdf-tools/raw/branch/main/asciiart.txt";
let artFileText: string; let artFileText: string;
if (artFilePath?.startsWith("http")) { if (artFilePath?.startsWith("http")) {
artFileText = await fetch(artFilePath).then((res) => res.text()); artFileText = await fetch(artFilePath).then((res) => res.text());