瀏覽代碼

Merge pull request #2400 from yidayoung/master

Fix compile issue on windows when language is not english
pull/2404/head
Fred Hebert 4 年之前
committed by GitHub
父節點
當前提交
bed5a1a505
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 2 個文件被更改,包括 18 次插入6 次删除
  1. +8
    -4
      src/rebar_file_utils.erl
  2. +10
    -2
      src/rebar_utils.erl

+ 8
- 4
src/rebar_file_utils.erl 查看文件

@ -163,13 +163,17 @@ win32_mklink_ok({error,{1,"Cannot create a file when that file already exists.\n
% File or dir is already in place; find if it is already a symlink (true) or
% if it is a directory (copy-required; false)
is_symlink(Target);
win32_mklink_ok(_, _) ->
false.
win32_mklink_ok(_, Target) ->
is_symlink(Target).
%% @private
is_symlink(Filename) ->
{ok, Info} = file:read_link_info(Filename),
Info#file_info.type == symlink.
case file:read_link_info(Filename) of
{ok, Info} ->
Info#file_info.type == symlink;
_ ->
false
end.
%% @private
%% drops the last 'node' of the filename, presumably the last dir such as 'src'

+ 10
- 2
src/rebar_utils.erl 查看文件

@ -675,12 +675,20 @@ debug_and_abort(Command, {Rc, Output}) ->
"~ts", [Command, Rc, Output]),
throw(rebar_abort).
port_line_to_list(Line) ->
case unicode:characters_to_list(Line) of
LineList when is_list(LineList) ->
LineList;
_ ->
binary_to_list(Line)
end.
sh_loop(Port, Fun, Acc) ->
receive
{Port, {data, {eol, Line}}} ->
sh_loop(Port, Fun, Fun(unicode:characters_to_list(Line) ++ "\n", Acc));
sh_loop(Port, Fun, Fun(port_line_to_list(Line) ++ "\n", Acc));
{Port, {data, {noeol, Line}}} ->
sh_loop(Port, Fun, Fun(unicode:characters_to_list(Line), Acc));
sh_loop(Port, Fun, Fun(port_line_to_list(Line), Acc));
{Port, eof} ->
Data = lists:flatten(lists:reverse(Acc)),
receive

Loading…
取消
儲存