Add .env support to make life easier

This commit is contained in:
ewin 2025-08-20 00:02:08 -06:00
parent 78ad0761b3
commit 79a833133c
Signed by: erin
SSH key fingerprint: SHA256:swjoHhREbZPbWe+gyJNi24d4NAxJSyUIm3fpZj4z3wc
7 changed files with 16 additions and 6 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env -S node --env-file-if-exists=.env
import {findEDBEntryID} from '../lib/api/lodestone.js';
import {getMediawikiClient} from '../lib/config.js';

View file

@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env -S node --env-file-if-exists=.env
import {findItemGTID} from '../lib/api/xivapi.js';
import {getMediawikiClient} from '../lib/config.js';

View file

@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env -S node --env-file-if-exists=.env
// Renames A-class Stellar Missions to replace A-1, A-2, A-3 difficulty
// indicators with the new empty/EX/EX+ naming used in patch 7.3.
// https://na.finalfantasyxiv.com/lodestone/topics/detail/907c6d2aa020c0e4458ed1477668521fb4a117ec#:~:text=The%20notation,adjusted%2E

View file

@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env -S node --env-file-if-exists=.env
// Adds infobox parameters for Viera and Hrothgar hat compatibility based on
// data compiled by Crye. Expects there to be a `hats.csv` file in the repo root
// which is an export of the "HEAD" sheet of this Google Sheets document:
@ -14,7 +14,7 @@ import {addParameterAtBottom, setExistingParameter} from '../../lib/util/templat
const mw = await getMediawikiClient();
// parse CSV, naively assume there are no quotes or backslashes (because i checked)
const data = readFileSync(join(import.meta.dirname, '../../hats.csv'), 'utf-8').split(/\r?\n/g).map(line => line && line.split(','));
const data = readFileSync(join(import.meta.dirname, '../../hats.csv'), 'utf-8').split(/\r?\n/g).filter(l => l).map(line => line && line.split(','));
const headers = data.splice(0, 1)[0];
const COL_ITEM = headers.findIndex(field => field.toLowerCase() === 'item');
const COL_VIERA = headers.findIndex(field => field.toLowerCase().includes('viera'));