diff options
author | Manuel Rubio <manuel@bosqueviejo.net> | 2013-09-19 00:59:51 +0200 |
---|---|---|
committer | Manuel Rubio <manuel@bosqueviejo.net> | 2013-09-19 00:59:51 +0200 |
commit | 37326620809f7822acbf42eafd10160b3106375c (patch) | |
tree | 2a6cd28a548ebea9c3b0437aed217e5e364bcf67 /src | |
parent | 620c4b01c6e59d47e92ea069f8510b8cb482ebae (diff) |
let vm.args and sys.config as optional
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_upgrade.erl | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/rebar_upgrade.erl b/src/rebar_upgrade.erl index d18603c..1441c5a 100644 --- a/src/rebar_upgrade.erl +++ b/src/rebar_upgrade.erl @@ -184,13 +184,23 @@ boot_files(TargetDir, Ver, Name) -> filename:join([TargetDir, "releases", Ver, "start_clean.boot"]), filename:join([".", ?TMP, "releases", Ver, "start_clean.boot"])), - {ok, _} = file:copy( - filename:join([TargetDir, "releases", Ver, "sys.config"]), - filename:join([".", ?TMP, "releases", Ver, "sys.config"])), + SysConfig = filename:join([TargetDir, "releases", Ver, "sys.config"]), + case filelib:is_regular(SysConfig) of + true -> + {ok, _} = file:copy( + SysConfig, + filename:join([".", ?TMP, "releases", Ver, "sys.config"])); + false -> ok + end, - {ok, _} = file:copy( - filename:join([TargetDir, "releases", Ver, "vm.args"]), - filename:join([".", ?TMP, "releases", Ver, "vm.args"])). + VmArgs = filename:join([TargetDir, "releases", Ver, "vm.args"]), + case filelib:is_regular(VmArgs) of + true -> + {ok, _} = file:copy( + VmArgs, + filename:join([".", ?TMP, "releases", Ver, "vm.args"])); + false -> {ok, 0} + end. make_tar(NameVer, NewVer, NewName) -> Filename = NameVer ++ ".tar.gz", |