Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to cwd as a base path for resources_dir & results_dir #134

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fluster/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,21 @@ def __init__(self) -> None:
):
self.test_suites_dir = TEST_SUITES_DIR_SYS

# If the resources dir doesn't exist under the script location, fallback
# to the current working directory.
self.resources_dir = os.path.join(
os.path.join(os.path.dirname(__file__), ".."), RESOURCES_DIR
)
if not os.path.exists(self.resources_dir):
self.resources_dir = os.path.join(os.getcwd(), RESOURCES_DIR)

# If the results dir doesn't exist under the script location, fallback
# to the current working directory.
self.results_dir = os.path.join(
os.path.join(os.path.dirname(__file__), ".."), RESULTS_DIR
)
if not os.path.exists(self.results_dir):
self.results_dir = os.path.join(os.getcwd(), RESULTS_DIR)

self.parser = self._create_parser()

Expand Down
Loading