Add button to reload the cache in the import helper

This commit is contained in:
Pieter Vander Vennet 2022-04-20 02:16:41 +02:00
parent 50a7597c5a
commit 34e7a98d5d
3 changed files with 37 additions and 19 deletions

View file

@ -1,6 +1,7 @@
import * as fs from "fs";
import {TagUtils} from "../Logic/Tags/TagUtils";
import {writeFileSync} from "fs";
import {TagsFilter} from "../Logic/Tags/TagsFilter";
function main(args) {
if (args.length < 2) {
@ -13,7 +14,13 @@ function main(args) {
const output = args[2]
const data = JSON.parse(fs.readFileSync(path, "UTF8"))
const filter = TagUtils.Tag(JSON.parse(spec))
let filter : TagsFilter ;
try{
filter = TagUtils.Tag(JSON.parse(spec))
}catch(e){
filter = TagUtils.Tag(spec)
}
const features = data.features.filter(f => filter.matchesProperties(f.properties))
if(features.length === 0){