eserte / Doit

a scripting framework
https://metacpan.org/release/Doit
0 stars 0 forks source link

Doit call and call_with_runner okay for non remote use? #9

Open srchulo opened 5 years ago

srchulo commented 5 years ago

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.

srchulo commented 5 years ago

Actually, it looks like call is working locally for me, but there is no log in --dry-run or regular run mode.