From 0edb78957c58faba4afdcc5a01f1b89700b2208a Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 31 Dec 2023 15:18:07 +0100 Subject: [PATCH] Add documentation to script --- scripts/generateReviewsAnalysis.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/generateReviewsAnalysis.ts b/scripts/generateReviewsAnalysis.ts index 4af7904d2..811cf902c 100644 --- a/scripts/generateReviewsAnalysis.ts +++ b/scripts/generateReviewsAnalysis.ts @@ -4,6 +4,10 @@ import { Review } from "mangrove-reviews-typescript" import { parse } from "csv-parse" import { Feature, FeatureCollection, Point } from "geojson" +/** + * To be run from the repository root, e.g. + * vite-node scripts/generateReviewsAnalysis.ts -- ~/Downloads/mangrove.reviews_1704031255.csv + */ export default class GenerateReviewsAnalysis extends Script { constructor() { super("Analyses a CSV-file with Mangrove reviews") @@ -104,6 +108,11 @@ export default class GenerateReviewsAnalysis extends Script { } async main(args: string[]): Promise { + if (args.length === 0) { + console.log( + "Usage: enter file path of mangrove.reviews_timestamp.csv as first argument" + ) + } const datapath = args[0] ?? "../MapComplete-data/mangrove.reviews_1674234503.csv" await this.analyze(datapath) }