diff --git a/bake/bakefile.py b/bake/bakefile.py index 2edf21a..283877c 100644 --- a/bake/bakefile.py +++ b/bake/bakefile.py @@ -147,11 +147,13 @@ class Bakefile: 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: