diff --git a/bake/bakefile.py b/bake/bakefile.py index 325c3a7..8de279a 100644 --- a/bake/bakefile.py +++ b/bake/bakefile.py @@ -131,18 +131,20 @@ class Bakefile: @classmethod def find( - Class, *, filename="Bashfile", root=os.getcwd(), max_depth=4, topdown=False + Class, *, filename="Bakefile", root=os.getcwd(), max_depth=4, topdown=False ): """Returns the path of a Pipfile in parent directories.""" i = 0 for c, d, f in utils.walk_up(root): if i > max_depth: - raise NoBakefileFound(f"No {filename} found!") + break elif filename in f: return Class(path=os.path.join(c, filename)) i += 1 + raise NoBakefileFound(f"No {filename} found!") + @property def source(self): with open(self.path, "r") as f: