bnosac / cronR

A simple R package for managing your cron jobs.
Other
288 stars 38 forks source link

Mailto #52

Closed adamcagle closed 2 years ago

adamcagle commented 2 years ago

Support Sending Email When And Only When Script Errors

Other Changes

Bug Fix

Warning Message

jwijffels commented 2 years ago

Thanks for the changes and the detailed description. Here some remarks:

adamcagle commented 2 years ago

No problem! I made those changes. Just let me know if there's anything else that's needed.

jwijffels commented 2 years ago

Thanks for the changes. Can you replace argument output_on_error = FALSE to type = c("default", "output_on_error") and user type = match.arg(type) inside the function and use argument type to do the logic, that will still allow to add other types in the future while making the function call the same. Like type = 'multiple' where you can pass multiple R scripts e.g. You can also bump the version and add a news item, I'll merge then.

adamcagle commented 2 years ago

Will do! That actually gives me another idea. You might want some scripts to generate an output everytime they run so that you'd get an email regardless of whether or not there was an error. I'll add output_always as a third option if you're on board with that.

jwijffels commented 2 years ago

I'm fine with other options regarding type. Feel free to add pull requests. Would be good to have some unit tests of this of course.

I didn't check in detail the change you did here: https://github.com/bnosac/cronR/pull/52/files#diff-e9a0c9c4bebffe527085d3173fc97dc8c1ae0d27d0fd699a59583525f6926c27R23 but I presume that will be fine.

adamcagle commented 2 years ago

Thanks for merging! I'll work on some unit tests next.