diff --git a/DataRepo/loaders/msruns_loader.py b/DataRepo/loaders/msruns_loader.py index 48d18408..65b9698c 100644 --- a/DataRepo/loaders/msruns_loader.py +++ b/DataRepo/loaders/msruns_loader.py @@ -2337,6 +2337,8 @@ def get_mzxml_files(cls, files=None, dir=None): return files if dir is None: return [] + if dir == "": + dir = os.getcwd() return [ os.path.join(p, fl) for p, _, fs in os.walk(dir) diff --git a/DataRepo/loaders/study_loader.py b/DataRepo/loaders/study_loader.py index f5594c4d..173a8d42 100644 --- a/DataRepo/loaders/study_loader.py +++ b/DataRepo/loaders/study_loader.py @@ -328,9 +328,11 @@ def __init__(self, *args, **kwargs): # Before the superclass constructor is called, we want to use the file path to get its enclosing directory as a # default for the (custom derived class argument:) mzxml_dir - study_file = kwargs.get("file") - study_dir = None if study_file is None else os.path.dirname(study_file) - mzxml_dir = kwargs.pop("mzxml_dir", study_dir) + mzxml_dir = kwargs.pop("mzxml_dir", None) + if mzxml_dir is None: + study_file = kwargs.get("file") + study_dir = None if study_file is None else os.path.dirname(study_file) + mzxml_dir = study_dir self.mzxml_files = MSRunsLoader.get_mzxml_files(dir=mzxml_dir) self.exclude_sheets = kwargs.pop("exclude_sheets", []) or [] diff --git a/DataRepo/management/commands/export_studies.py b/DataRepo/management/commands/export_studies.py index 23942f8b..afffa03c 100644 --- a/DataRepo/management/commands/export_studies.py +++ b/DataRepo/management/commands/export_studies.py @@ -1,3 +1,5 @@ +import os + from django.core.management import BaseCommand from DataRepo.utils.studies_exporter import StudiesExporter @@ -11,7 +13,7 @@ def add_arguments(self, parser): parser.add_argument( "--outdir", required=True, - default=".", + default=os.getcwd(), help="Directory to create and save exported files.", ) parser.add_argument(