浏览代码

Fix repeated bootstrap runs

Updating the bootstrap script in #1689 made it so symlinks that already
exist return `exist` rather than ok, in line with the regular code.
However the bootstrap module wouldn't handle this case.

This fixes the problem by ensuring that `exists` is as valid as `ok`.
pull/1692/head
Fred Hebert 7 年前
父节点
当前提交
718291e516
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      bootstrap

+ 4
- 3
bootstrap 查看文件

@ -168,8 +168,9 @@ compile_file(File, Opts) ->
bootstrap_rebar3() ->
filelib:ensure_dir("_build/default/lib/rebar/ebin/dummy.beam"),
code:add_path("_build/default/lib/rebar/ebin/"),
ok = symlink_or_copy(filename:absname("src"),
filename:absname("_build/default/lib/rebar/src")),
Res = symlink_or_copy(filename:absname("src"),
filename:absname("_build/default/lib/rebar/src")),
true = Res == ok orelse Res == exists,
Sources = ["src/rebar_resource.erl" | filelib:wildcard("src/*.erl")],
[compile_file(X, [{outdir, "_build/default/lib/rebar/ebin/"}
,return | additional_defines()]) || X <- Sources],
@ -648,4 +649,4 @@ join([H|T], Sep) ->
chr(S, C) when is_integer(C) -> chr(S, C, 1).
chr([C|_Cs], C, I) -> I;
chr([_|Cs], C, I) -> chr(Cs, C, I+1);
chr([], _C, _I) -> 0.
chr([], _C, _I) -> 0.

正在加载...
取消
保存