Open
Conversation
…e_task_alias function for creating tasks where the task_name and function_name are different
kyleburton
reviewed
Jan 13, 2019
bake
Outdated
| name="${1:-}" | ||
| fn_name="${2:-}" | ||
| local short_desc="${3:-No Description for task: $name}" | ||
| if [ -z "$name" ] || [ -z "$fn_name" ]; then |
Owner
There was a problem hiding this comment.
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
kyleburton
reviewed
Jan 13, 2019
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!" |
Owner
There was a problem hiding this comment.
Could it make sense to use bake_echo_red here?
Author
There was a problem hiding this comment.
It could, actually, now that I'm thinking about it, we could use bake_log_fatal or bake_log_error
0ba8f98 to
a721af8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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