Skip to content

Commit

Permalink
make file referencing more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
mingness committed Nov 8, 2024
1 parent 49bfb07 commit e92d872
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion scripts/add_new_contribution_to_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
from datetime import datetime
import json
import pathlib
from sys import argv

from ruamel.yaml import YAML
Expand All @@ -25,7 +26,7 @@
props['download'] = props['source'][:props['source'].rfind('.')] + '.zip'

# open database
database_file = '../contributions.yaml'
database_file = pathlib.Path(__file__).parent.parent / 'contributions.yaml'

yaml = YAML()
with open(database_file, 'r') as db:
Expand Down
3 changes: 2 additions & 1 deletion scripts/fetch_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import argparse
from datetime import datetime
import pathlib
from ruamel.yaml import YAML

from parse_and_validate_properties_txt import read_properties_txt, parse_text, validate_existing
Expand Down Expand Up @@ -81,7 +82,7 @@ def process_contribution(contribution):
if args.index:
index = args.index

database_file = '../contributions.yaml'
database_file = pathlib.Path(__file__).parent.parent / 'contributions.yaml'

# read in database yaml file
yaml = YAML()
Expand Down
3 changes: 2 additions & 1 deletion scripts/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pathlib
from ruamel.yaml import YAML

database_file = '../contributions.yaml'
database_file = pathlib.Path(__file__).parent.parent / 'contributions.yaml'


def get_contributions():
Expand Down

0 comments on commit e92d872

Please sign in to comment.