Skip to content

Commit b8f882d

Browse files
committed
Use repository_ctx.report_progress instead of execute with echo
Execute with echo does not work in windows
1 parent 3cb9960 commit b8f882d

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

repositories/erlang_config.bzl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,11 @@ def _erlang_home_from_erl_path(repository_ctx, erl_path):
136136
erlang_home = str(erl_path.dirname.dirname)
137137
return erlang_home
138138

139+
def _is_windows(repository_ctx):
140+
return repository_ctx.os.name.lower().find("windows") != -1
141+
139142
def _default_erlang_dict(repository_ctx):
140-
if repository_ctx.os.name.find("windows") > -1:
143+
if _is_windows(repository_ctx):
141144
if ERLANG_HOME_ENV_VAR in repository_ctx.os.environ:
142145
erlang_home = repository_ctx.os.environ[ERLANG_HOME_ENV_VAR]
143146
erlang_home = erlang_home.replace("\\", "/")
@@ -178,17 +181,10 @@ def _default_erlang_dict(repository_ctx):
178181
),
179182
}
180183
else:
181-
repository_ctx.execute(
182-
[
183-
repository_ctx.which("echo"),
184-
"RULES_ERLANG: " + "Could not determine erlang version for {}: {}".format(
185-
erl_path,
186-
version.stderr,
187-
),
188-
],
189-
timeout = 1,
190-
quiet = False,
191-
)
184+
repository_ctx.report_progress("Could not determine erlang version for {}: {}".format(
185+
erl_path,
186+
version.stderr,
187+
))
192188
return {
193189
_DEFAULT_EXTERNAL_ERLANG_PACKAGE_NAME: struct(
194190
type = INSTALLATION_TYPE_EXTERNAL,

0 commit comments

Comments
 (0)