diff options
author | Eric <[email protected]> | 2012-12-30 20:01:39 -0500 |
---|---|---|
committer | Eric <[email protected]> | 2012-12-30 20:01:39 -0500 |
commit | 60e04b48942a8d2e0d401ae5deb84e4dc61d05f5 (patch) | |
tree | f904aa417d628c4b2183099995ea0b28c478bbc6 /src/rcl_cmd_args.erl | |
parent | 7313be05d2805a3cf699e25d160401fd95635e33 (diff) | |
download | relx-60e04b48942a8d2e0d401ae5deb84e4dc61d05f5.tar.gz relx-60e04b48942a8d2e0d401ae5deb84e4dc61d05f5.tar.bz2 relx-60e04b48942a8d2e0d401ae5deb84e4dc61d05f5.zip |
support the ability to specify a root directory
Diffstat (limited to 'src/rcl_cmd_args.erl')
-rw-r--r-- | src/rcl_cmd_args.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rcl_cmd_args.erl b/src/rcl_cmd_args.erl index 3bb9f41..9d829d3 100644 --- a/src/rcl_cmd_args.erl +++ b/src/rcl_cmd_args.erl @@ -160,9 +160,22 @@ create_lib_dirs(Opts, Acc) -> Error = {error, _} -> Error; ok -> - {ok, [{lib_dirs, [filename:absname(Dir) || Dir <- Dirs]} | Acc]} + create_root_dir(Opts, [{lib_dirs, [filename:absname(Dir) || Dir <- Dirs]} | Acc]) end. +-spec create_root_dir([getopt:option()], rcl_state:cmd_args()) -> + {ok, rcl_state:cmd_args()} | relcool:error(). +create_root_dir(Opts, Acc) -> + Dir = proplists:get_value(root_dir, Opts, undefined), + case Dir of + undefined -> + {ok, Cwd} = file:get_cwd(), + {ok, [{root_dir, Cwd} | Acc]}; + _ -> + {ok, [{root_dir, Dir} | Acc]} + end. + + -spec check_lib_dirs([string()]) -> ok | relcool:error(). check_lib_dirs([]) -> ok; |