diff --git a/package.json b/package.json index cd624381a..4463da124 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "generate:contributor-list": "vite-node scripts/generateContributors.ts", "generate:service-worker": "tsc src/service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i.bak \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js && rm public/service-worker.js.bak", "reset:layeroverview": "npm run prep:layeroverview && npm run generate:layeroverview && npm run refresh:layeroverview", - "prep:layeroverview": "mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./src/assets/generated/known_layers.json && rm -f ./src/assets/generated/layers/*.json && rm -f ./src/assets/generated/themes/*.json && cp ./assets/layers/usersettings/usersettings.json ./src/assets/generated/layers/usersettings.json && echo '{}' > ./src/assets/generated/layers/favourite.json && echo '{}' > ./src/assets/generated/layers/summary.json && echo '{}' > ./src/assets/generated/layers/last_click.json && echo '[]' > ./src/assets/generated/theme_overview.json /theme_overview.json", + "prep:layeroverview": "./scripts/initFiles.sh", "generate": "npm run generate:licenses && npm run generate:images && npm run generate:charging-stations && npm run generate:translations && npm run refresh:layeroverview && npm run generate:service-worker", "generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -", "clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm", diff --git a/scripts/initFiles.sh b/scripts/initFiles.sh new file mode 100644 index 000000000..0d0cb04c6 --- /dev/null +++ b/scripts/initFiles.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +# Creates various empty (stub) version of files + +mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/generated/known_themes.json + echo {\\\"layers\\\": []} > ./src/assets/generated/known_layers.json + rm -f ./src/assets/generated/layers/*.json + rm -f ./src/assets/generated/themes/*.json + cp ./assets/layers/usersettings/usersettings.json ./src/assets/generated/layers/usersettings.json + echo '{}' > ./src/assets/generated/layers/favourite.json + echo '{}' > ./src/assets/generated/layers/summary.json + echo '{}' > ./src/assets/generated/layers/last_click.json +echo '{}' > ./src/assets/generated/layers/search.json + echo '[]' > ./src/assets/generated/theme_overview.json /theme_overview.json