13 lines
423 B
Python
13 lines
423 B
Python
def require(repository_ctx, executable):
|
|
path = repository_ctx.which(executable)
|
|
if path == None:
|
|
fail("{} must be available in PATH.".format(executable))
|
|
return path
|
|
|
|
|
|
def execute(repository_ctx, arguments):
|
|
result = repository_ctx.execute(arguments)
|
|
if result.return_code != 0:
|
|
fail("command failed: {}\n{}".format(" ".join(arguments), result.stderr))
|
|
return result.stdout.strip()
|