I wanted to call local subroutines in my Doit script that would show up when running with --dry-run and would run the code for you when not in a --dry-run. Doit has this functionality, but only for remote/sudo calls. Would it be possible to expand this to work for normal subroutine calls as well? Currently I do this to get around it:
# @args could be interpolated more clearly
if ($doit->is_dry_run) {
info "Will call x with args @args (dry-run)";
} else {
info "Calling x with args @args"
x(@args);
}
And it looks like call and call_with_runner do not work because they expect the subroutines to be required into Doit for an ssh/sudo command.
I wanted to call local subroutines in my Doit script that would show up when running with
--dry-run
and would run the code for you when not in a--dry-run
. Doit has this functionality, but only for remote/sudo calls. Would it be possible to expand this to work for normal subroutine calls as well? Currently I do this to get around it:And it looks like
call
andcall_with_runner
do not work because they expect the subroutines to be required into Doit for an ssh/sudo command.