toolchain: display proper error if the environ _DIR is not valid

This commit is contained in:
Mathieu Virbel 2015-08-07 18:07:37 +02:00
parent 9826a7cba0
commit ee1b4dba0e

View file

@ -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