diff --git a/generate_issues.py b/generate_issues.py index 937abda..1f9f41a 100644 --- a/generate_issues.py +++ b/generate_issues.py @@ -1,8 +1,9 @@ -import os import csv -import re from dotenv import load_dotenv +import os +import re import requests +import sys load_dotenv() FORGEJO_API_TOKEN = os.getenv("FORGEJO_API_TOKEN") @@ -70,9 +71,6 @@ def parse_notes_section(notes): def parse_harvest_csv(file=None): global issues_and_urls - if file is None: - file = prompt_for_file(file) - print('Beginning parsing for issues') with open(file, 'r') as f: @@ -100,5 +98,12 @@ def parse_harvest_csv(file=None): row_count += 1 if __name__ == "__main__": - parse_harvest_csv() + try: + file_path = sys.argv[1] + except Exception as e: + print("No file provided, exitting") + quit() + if file_path: + check_for_file(file_path) + parse_harvest_csv(file_path)