-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to verify maps use mapinfo.lua
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Verifies all maps use mapinfo.lua and not older methods. | ||
|
||
import { readMapList, fetchMapsMetadata } from './maps_metadata.js'; | ||
|
||
const maps = await readMapList(); | ||
const mapsMetadata = await fetchMapsMetadata(maps); | ||
|
||
const whitelist: Set<string> = new Set(['Mescaline_V2']); | ||
|
||
let anyWithoutMapinfo = false; | ||
for (const [rowyId, map] of Object.entries(maps)) { | ||
const meta = mapsMetadata.get(rowyId); | ||
if (!meta.mapInfo) { | ||
if (whitelist.has(map.springName)) { | ||
console.log(`${map.springName} doesn't use mapinfo.lua but whitelisted.`); | ||
} else { | ||
console.error(`ERROR: ${map.springName} doesn't use mapinfo.lua.`); | ||
anyWithoutMapinfo = true; | ||
} | ||
} | ||
} | ||
if (anyWithoutMapinfo) { | ||
process.exit(1); | ||
} |