aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2014-11-02 08:06:52 -0600
committerTristan Sloughter <[email protected]>2014-11-02 08:06:52 -0600
commit9b88efae84344abfb601280de4028b3dfe094e2f (patch)
treebb6b32a11e0679b4e37a56881611db1306378722
parent016976897769572b8dd1cddc1fc9708c8d4bb306 (diff)
parent5028ef9e0e4a3f505da19c005800f273af671534 (diff)
downloadrelx-9b88efae84344abfb601280de4028b3dfe094e2f.tar.gz
relx-9b88efae84344abfb601280de4028b3dfe094e2f.tar.bz2
relx-9b88efae84344abfb601280de4028b3dfe094e2f.zip
Merge pull request #248 from ichernetsky/master
Allow to specify a path to vm.args through command-line arguments
-rw-r--r--README.md1
-rw-r--r--src/relx.erl1
-rw-r--r--src/rlx_cmd_args.erl3
-rw-r--r--src/rlx_config.erl7
4 files changed, 11 insertions, 1 deletions
diff --git a/README.md b/README.md
index 7c68dfb..9e7217c 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ Options
| -a | --override_app | string | | An app name and a directory to override in the form appname:dir |
| -c | --config | string | ./relx.config | Config file path |
| | --overlay_vars | string | | Path to a file of overlay variables |
+| | --vm_args | string | | Path to a file to use for vm.args |
| | --sys_config | string | | Path to a file to use for sys.config |
| -d | --dev-mode | boolean | false | Symlink all applications and configuration into the release instead of copying|
| -i | --include-erts | boolean/string | true | If true include a copy of erts used to build with, if a path include erts at that path. If false, do not include erts |
diff --git a/src/relx.erl b/src/relx.erl
index 37918be..433e0a5 100644
--- a/src/relx.erl
+++ b/src/relx.erl
@@ -210,6 +210,7 @@ opt_spec_list() ->
"Provide an app name and a directory to override in the form <appname>:<app directory>"},
{config, $c, "config", {string, ""}, "The path to a config file"},
{overlay_vars, undefined, "overlay_vars", string, "Path to a file of overlay variables"},
+ {vm_args, undefined, "vm_args", string, "Path to a file to use for vm.args"},
{sys_config, undefined, "sys_config", string, "Path to a file to use for sys.config"},
{system_libs, undefined, "system_libs", string, "Path to dir of Erlang system libs"},
{version, undefined, "version", undefined, "Print relx version"},
diff --git a/src/rlx_cmd_args.erl b/src/rlx_cmd_args.erl
index ac3e718..44fd226 100644
--- a/src/rlx_cmd_args.erl
+++ b/src/rlx_cmd_args.erl
@@ -240,6 +240,9 @@ create(overlay_vars, Opts)->
create(sys_config, Opts) ->
SysConfig = proplists:get_value(sys_config, Opts, undefined),
{sys_config, SysConfig};
+create(vm_args, Opts) ->
+ VmArgs = proplists:get_value(vm_args, Opts, undefined),
+ {vm_args, VmArgs};
create(system_libs, Opts) ->
SystemLibs = proplists:get_value(system_libs, Opts, undefined),
{system_libs, SystemLibs};
diff --git a/src/rlx_config.erl b/src/rlx_config.erl
index dbfe1c6..07ac2c5 100644
--- a/src/rlx_config.erl
+++ b/src/rlx_config.erl
@@ -205,7 +205,12 @@ load_terms({release, {RelName, Vsn}, {erts, ErtsVsn},
{ok, rlx_state:add_configured_release(State, Release1)}
end;
load_terms({vm_args, VmArgs}, {ok, State}) ->
- {ok, rlx_state:vm_args(State, filename:absname(VmArgs))};
+ case rlx_state:vm_args(State) of
+ undefined ->
+ {ok, rlx_state:vm_args(State, filename:absname(VmArgs))};
+ _ ->
+ {ok, State}
+ end;
load_terms({sys_config, SysConfig}, {ok, State}) ->
case rlx_state:sys_config(State) of
undefined ->