Make uncanny skip hidden/non-PNG files

This commit is contained in:
Essem 2022-10-01 12:03:37 -05:00
parent f781fb1ae5
commit c5b50cf73b
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -4,7 +4,9 @@ import { readdirSync } from "fs";
import { resolve, dirname } from "path";
import { fileURLToPath } from "url";
const prompts = ["you found:", "your dad is:", "you ate:", "your mom is:", "your sister is:", "you saw:", "you get lost in:", "you find:", "you grab:", "you pull out of your pocket:", "you fight:", "it's in your room:"];
const names = readdirSync(resolve(dirname(fileURLToPath(import.meta.url)), "../../assets/images/uncanny/")).map((val) => {
const names = readdirSync(resolve(dirname(fileURLToPath(import.meta.url)), "../../assets/images/uncanny/")).filter((val) => {
if (!val.startsWith(".") && val.endsWith(".png")) return true;
}).map((val) => {
return val.split(".")[0];
});