Scripts: add error message in case of incorrect usage

This commit is contained in:
Pieter Vander Vennet 2024-02-20 16:13:38 +01:00
parent 1528dfaae1
commit 2482ecefc2
2 changed files with 5 additions and 1 deletions

View file

@ -92,7 +92,8 @@
"weblate-merge": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations",
"weblate-fix-heavy": "git fetch weblate-hosted-layers; git fetch weblate-hosted-core; git merge weblate-hosted-layers/master weblate-hosted-core/master ",
"housekeeping": "git pull && npx update-browserslist-db@latest && npm run weblate-fix-heavy && npm run generate && npm run generate:docs && npm run generate:contributor-list && vite-node scripts/fetchLanguages.ts && npm run format && git add assets/ langs/ Docs/ **/*.ts Docs/* src/* && git commit -m 'chore: automated housekeeping...'",
"reuse-compliance": "reuse lint"
"reuse-compliance": "reuse lint",
"backup:images": "vite-node scripts/generateImageAnalysis.ts -- ~/data/imgur-image-backup/"
},
"keywords": [
"OpenStreetMap",

View file

@ -451,6 +451,9 @@ export default class GenerateImageAnalysis extends Script {
args = args.filter((a) => a !== "--cached")
const datapath = args[1] ?? "../../git/MapComplete-data/ImageLicenseInfo"
const imageBackupPath = args[0]
if(imageBackupPath === "" || imageBackupPath === undefined){
throw "No imageBackup path specified"
}
await this.downloadData(datapath, cached)
// await this.downloadViews(datapath)