build: add Bazel Rust workflow
This commit was merged in pull request #2.
This commit is contained in:
12
bazel/utils.bzl
Normal file
12
bazel/utils.bzl
Normal file
@@ -0,0 +1,12 @@
|
||||
def require_env(repository_ctx, variable):
|
||||
value = repository_ctx.os.environ.get(variable)
|
||||
if not value:
|
||||
fail("{} must be set.".format(variable))
|
||||
return value
|
||||
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user