From ee1b4dba0ee161772ac17ae329aae2b54e4ffbc9 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Fri, 7 Aug 2015 18:07:37 +0200 Subject: [PATCH] toolchain: display proper error if the environ _DIR is not valid --- toolchain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolchain.py b/toolchain.py index 9e5b1b4..5d3fdd6 100755 --- a/toolchain.py +++ b/toolchain.py @@ -556,11 +556,12 @@ class Recipe(object): """Check if there is a variable name to specify a custom version / directory to use instead of the current url. """ - d = environ.get("{}_DIR".format(self.name.upper())) + envname = "{}_DIR".format(self.name.upper()) + d = environ.get(envname) if not d: return if not exists(d): - return + raise ValueError("Invalid path passed into {}".format(envname)) return d @cache_execution