Skip to content

Commit

Permalink
add find_mta_directory function (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
midays authored May 30, 2024
1 parent a0102d4 commit 068c231
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,10 @@ def run_command(command):
raise Exception(f"failed to run command {command},\n {result.stderr}")

return result.stdout


def find_mta_directory(extensions_dir_path):
for dir_name in os.listdir(extensions_dir_path):
if os.path.isdir(os.path.join(extensions_dir_path, dir_name)) and "mta" in dir_name.lower():
return os.path.join(extensions_dir_path, dir_name)
raise Exception(f"No directory containing 'mta' found in {extensions_dir_path}")

0 comments on commit 068c231

Please sign in to comment.