mirror of
https://github.com/smogon/sprites.git
synced 2026-04-25 07:18:19 -05:00
ps items sheet: restore __dirname
This commit is contained in:
parent
3567fbbe04
commit
c8ac9d5c96
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
import path from 'path';
|
||||
import * as spritedata from '@smogon/sprite-data';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
function toPSID(name) {
|
||||
return name.toLowerCase().replace(/[^a-z0-9]+/g, '');
|
||||
|
|
@ -528,7 +531,7 @@ const found = new Map;
|
|||
|
||||
for (const [num, {sid, name}] of spritedata.itemEntries()) {
|
||||
const id = toPSID(name);
|
||||
found.set(id, path.join("newsrc/minisprites/items", sid + ".png"));
|
||||
found.set(id, path.join(__dirname, "newsrc/minisprites/items", sid + ".png"));
|
||||
}
|
||||
|
||||
const entries = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user