Is there a way to invoke a command from another command? #522
-
Let's say you have a two high level functions in and your bashly config look like
Let's say
And invoke that same create_component function in It would be really cool for to be able to just invoke itself with another command like
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I see the code in the commands as a simple, "dumb" controller code. So my short recommendation is this: However, if you really want to, you can call the other command as you call any other bash command - meaning, invoke your script (assuming you know it is installed in the This was asked here and answered with more details here. If you feel that none of these sit right, and wish to propose another approach - I am open to further discussion. |
Beta Was this translation helpful? Give feedback.
I see the code in the commands as a simple, "dumb" controller code. So my short recommendation is this:
If you have code that you need to run in multiple places, create a
lib
function for it, and call it from multiple places.I recommend avoiding calling one command from another.
However, if you really want to, you can call the other command as you call any other bash command - meaning, invoke your script (assuming you know it is installed in the
PATH
).This was asked here and answered with more details here.
If you feel that none of these sit right, and wish to propose another approach - I am open to further discussion.