Open hrubi opened 5 years ago
The reason is to make sure that any paths in the management scripts are relative to the release root, rather than somewhere else on the file system. I think this specific issue could be addressed in a backwards-compatible way by storing the original working directory and restoring it when calling commands that will evaluate user-provided arguments to custom commands.
Actually removing that line is a bigger change, as it would take some time to figure out if there is anything that depends on the current behavior or not, and would be a breaking change for users at this point (though I imagine most would be in favor of the change in general, as would I, but having it happen without warning isn't desirable).
Steps to reproduce
Description of issue
I found it inconvenient that when running the release management script commands which take a path as an argument (e.g. the
eval
or a custom one), that the path is interpreted as relative to theRELEASE_ROOT_DIR
. It is counter-intuitive for the end user of the management script commands as he has to know that the relative path is treated that way or to use absolute path.I'm not yet sure about the motivation why the
_build/prod/rel/<name>/releases/<version>/myapp.sh
does cd into the release root nor what are the implications of not doing so. The source code in question is in priv/templates/release_rc_main.eexDistillery: 2.0.14 Erlang: 21.1.1 OS: Linux