forked from MapComplete/MapComplete
Add github hash to service worker to auto-update caches
This commit is contained in:
parent
bbe1d7c35e
commit
631108954e
3 changed files with 6 additions and 5 deletions
|
@ -34,7 +34,7 @@
|
|||
"generate:report": "cd Docs/Tools && ./compileStats.sh && git commit . -m 'New statistics ands graphs' && git push",
|
||||
"generate:contributor-list": "ts-node scripts/generateContributors.ts",
|
||||
"generate:schemas": "ts2json-schema -p Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && ts-node scripts/fixSchemas.ts ",
|
||||
"generate:service-worker": "tsc service-worker.ts",
|
||||
"generate:service-worker": "tsc service-worker.ts && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" service-worker.js",
|
||||
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
|
||||
"reset:layeroverview": "echo {\\\"layers\\\":[], \\\"themes\\\":[]} > ./assets/generated/known_layers_and_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json",
|
||||
"generate": "mkdir -p ./assets/generated && npm run reset:layeroverview && npm run generate:images && npm run generate:charging-stations && npm run generate:translations && npm run generate:licenses && npm run generate:layeroverview && npm run generate:service-worker",
|
||||
|
|
|
@ -10,8 +10,9 @@ npm run generate:translations
|
|||
# Translation generation went fine - commit
|
||||
git add langs/
|
||||
git add assets/
|
||||
git commit -m "Merge weblate trangsslations and regenerate translations"
|
||||
git commit -m "Merge weblate translations and regenerate translations"
|
||||
git push
|
||||
else
|
||||
echo "Generation of translations failed!"
|
||||
git checkout HEAD
|
||||
git merge --abort
|
||||
fi
|
|
@ -1,4 +1,4 @@
|
|||
const version = "0.0.8"
|
||||
const version = "0.0.8-GITHUB-COMMIT"
|
||||
|
||||
interface ServiceWorkerFetchEvent extends Event {
|
||||
request: RequestInfo & {url: string},
|
||||
|
|
Loading…
Reference in a new issue