-
Notifications
You must be signed in to change notification settings - Fork 8
Support Aliasing bake tasks #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…e_task_alias function for creating tasks where the task_name and function_name are different
bake
Outdated
| name="${1:-}" | ||
| fn_name="${2:-}" | ||
| local short_desc="${3:-No Description for task: $name}" | ||
| if [ -z "$name" ] || [ -z "$fn_name" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's OK w/you, lets try to use [[ in lieu of [ (apologies if I'm not doing that consistently elsewhere), this could then be written as:
if [[ -z "$name" && -z "$fn_name" ]]; then
bake
Outdated
| fn_name="${2:-}" | ||
| local short_desc="${3:-No Description for task: $name}" | ||
| if [ -z "$name" ] || [ -z "$fn_name" ]; then | ||
| echo "Error[bake_task_alias]: you must supply a task name and function name!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it make sense to use bake_echo_red here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could, actually, now that I'm thinking about it, we could use bake_log_fatal or bake_log_error
0ba8f98 to
a721af8
Compare
Overview
Added a new function
bake_task_aliasto be used alongside or in place ofbake_task.bake_task_aliasworks similarly tobake_taskexcept that it accepts an additional argument indicating the name of the bash function to call for this task.bake_task name [description] # vs bake_task_alias name function_name [description]The key functionality here allows for creating tasks in which the task name and function name differ.
This will generate the following task list