Scripts: update id-preset reading script

This commit is contained in:
Pieter Vander Vennet 2025-07-28 15:18:12 +02:00
parent 46d3054cc8
commit c7e7b4beed

View file

@ -1,5 +1,5 @@
/*** /***
* Parses presets from the iD repository and extracts some usefull tags from them * Parses presets from the iD repository and extracts some useful tags from them
*/ */
import ScriptUtils from "../ScriptUtils" import ScriptUtils from "../ScriptUtils"
import { existsSync, readFileSync, writeFileSync } from "fs" import { existsSync, readFileSync, writeFileSync } from "fs"
@ -8,6 +8,8 @@ import { LayerConfigJson } from "../../src/Models/ThemeConfig/Json/LayerConfigJs
import { MappingConfigJson } from "../../src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" import { MappingConfigJson } from "../../src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
import SmallLicense from "../../src/Models/smallLicense" import SmallLicense from "../../src/Models/smallLicense"
import Script from "../Script" import Script from "../Script"
import { GenerateLicenseInfo } from "../generateLicenseInfo"
interface IconThief { interface IconThief {
steal(iconName: string): boolean steal(iconName: string): boolean
@ -285,8 +287,20 @@ class IdThief {
class ReadIdPresets extends Script { class ReadIdPresets extends Script {
constructor() { constructor() {
super( super(
"Reads the id-tagging-schema repository and steals the presets; which will be written into 'id_presets.json'\n\nArguments: [path-to-repository] [path-to-target]\n" + [
"Note that default arguments are used"
"Reads the id-tagging-schema repository and steals the presets; which will be written into 'id_presets.json'\n\nArguments: [path-to-repository] [path-to-target]",
"Note that default arguments are used",
"Before running this script, you'll want to have the following file structure:",
"",
"# ../mapcomplete (this repository)",
"cd ../font-awesome && git pull && cd - # (https://github.com/FortAwesome/Font-Awesome)",
"cd ../temaki && git pull && cd - # https://github.com/ideditor/temaki",
"cd ../maki && git pull && cd - # https://github.com/mapbox/maki",
"cd ../id-tagging-schema && git pull && nvm use && npm ci && npm run build && npm run dist",
"",
"The source file is then loaded in ../id-tagging_schema/data/presets/shop/<various>.Json"
].join("\n")
) )
} }
@ -349,3 +363,4 @@ class ReadIdPresets extends Script {
} }
new ReadIdPresets().run() new ReadIdPresets().run()