Skip to content

Commit 651a89f

Browse files
Copilotlarsdecker
andcommitted
Fix macOS date command and add environment variable validation
Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
1 parent 6d95ecd commit 651a89f

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

packages/fints-cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ END_DATE=$(date -d "-1 day $(date +%Y-%m-01)" +%Y-%m-%d)
285285

286286
# For macOS (BSD date), use:
287287
# START_DATE=$(date -v-1m +%Y-%m-01)
288-
# END_DATE=$(date -v-1d -v1d +%Y-%m-%d)
288+
# END_DATE=$(date -v1d -v-1m -v-1d +%Y-%m-%d)
289289
# Or install GNU coreutils (brew install coreutils) and use 'gdate'
290290

291291
# Fetch transactions

packages/fints/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,17 @@ for (const account of accounts) {
286286
import { PinTanClient } from "fints-lib";
287287

288288
// Create client using environment variables for credentials
289+
// Ensure environment variables are set before running
290+
if (!process.env.FINTS_URL || !process.env.FINTS_USERNAME ||
291+
!process.env.FINTS_PIN || !process.env.FINTS_BLZ) {
292+
throw new Error("Required environment variables are not set");
293+
}
294+
289295
const client = new PinTanClient({
290-
url: process.env.FINTS_URL!,
291-
name: process.env.FINTS_USERNAME!,
292-
pin: process.env.FINTS_PIN!,
293-
blz: process.env.FINTS_BLZ!,
296+
url: process.env.FINTS_URL,
297+
name: process.env.FINTS_USERNAME,
298+
pin: process.env.FINTS_PIN,
299+
blz: process.env.FINTS_BLZ,
294300
debug: process.env.NODE_ENV === "development",
295301
});
296302

0 commit comments

Comments
 (0)