1
0
Fork 0

Add CLI argument for selecting banks
dustin/xactfetch/pipeline/head This commit looks good Details

When debugging a failure for one bank's website, I often want to run
the fetch for just that bank.  To date, I've been commenting out the
other bank, but that is silly.  Now, `xactfetch` can target a subset
of banks by specifying their name slug(s) as CLI arguments.
master
Dustin 2024-07-07 18:24:33 -05:00
parent dbc8be8e82
commit 72eae4d5b3
1 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import json
import logging
import os
import random
import sys
import subprocess
import urllib.parse
from pathlib import Path
@ -690,8 +691,11 @@ def main() -> None:
browser = pw.firefox.launch(headless=headless)
page = browser.new_page()
failed = False
banks = sys.argv[1:] or list(ACCOUNTS.keys())
if 'commerce' in banks:
if not download_commerce(page, end_date, token, importer):
failed = True
if 'chase' in banks:
if not download_chase(page, end_date, token, importer):
failed = True
raise SystemExit(1 if failed else 0)