diff --git a/package.json b/package.json index ea9feb268..207de5798 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/generateImageAnalysis.ts b/scripts/generateImageAnalysis.ts index 87f876d52..b83f08c6b 100644 --- a/scripts/generateImageAnalysis.ts +++ b/scripts/generateImageAnalysis.ts @@ -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)