diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2018-04-27 09:32:39 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2018-04-27 09:32:39 -0400 |
commit | 775261dd0b24d74e48f5873ef1ffff56c0c4829a (patch) | |
tree | 7fd2e052524ef247f95076de06ab7dad7dba6c9e /src | |
parent | 77058ac5b7b1593f047602184e8d2e1ee6bdb8aa (diff) |
Prevent copying or symlink non-existing src_dirs
This would cause crashes on linux and force people to have a src_dirs
config that is strictly matching what is on the file system rather than
acting as a specification of those that are valid.
To compare, if lib_dirs worked the same, then any repo that did not both
have apps/ and lib/ would crash, as the spec mentions both options as
valid.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_compile.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index 72320fb..1748118 100644 --- a/src/rebar_prv_compile.erl +++ b/src/rebar_prv_compile.erl @@ -236,7 +236,10 @@ copy_app_dirs(AppInfo, OldAppDir, AppDir) -> symlink_or_copy(OldAppDir, AppDir, Dir) -> Source = filename:join([OldAppDir, Dir]), Target = filename:join([AppDir, Dir]), - rebar_file_utils:symlink_or_copy(Source, Target). + case ec_file:is_dir(Source) of + true -> rebar_file_utils:symlink_or_copy(Source, Target); + false -> ok + end. copy(OldAppDir, AppDir, Dir) -> Source = filename:join([OldAppDir, Dir]), |