From 64f56c86860e2ba3dfcebe9c2ae5318caa32fcd7 Mon Sep 17 00:00:00 2001 From: Michael Muller Date: Mon, 25 Apr 2022 12:39:16 -0400 Subject: [PATCH] Change check for root directory during rollback (#1602) * Change check for root directory during rollback `rollback_tool` tries to infer the root of the nomulus tree by checking for a directory named "nomulus". This is potentially problematic (and, indeed, was for me) since there is no guarantee what that directory will be named. There are a number of features that characterize the root directory. Check for the presence of the `rollback_tool` wrapper script, as this is both at root level and tightly coupled to the python code, so hopefully we won't move it without testing that the script still works. --- release/rollback/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/rollback/common.py b/release/rollback/common.py index 73da29b46..bfec10c9d 100644 --- a/release/rollback/common.py +++ b/release/rollback/common.py @@ -108,7 +108,7 @@ def get_nomulus_root() -> str: The absolute path to the Nomulus root directory. """ for folder in pathlib.Path(__file__).parents: - if folder.name != 'nomulus': + if not folder.joinpath('rollback_tool').exists(): continue if not folder.joinpath('settings.gradle').exists(): continue