diff options
author | Leah Rowe <leah@libreboot.org> | 2025-05-03 04:16:10 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-05-05 12:18:22 +0100 |
commit | aa39abfff850e5d4435dc4924ed636364c908668 (patch) | |
tree | 40648302c042cce40dae3fa0ddbd83caa2c5b331 /include/init.sh | |
parent | 69b5d63f92ec3fbd8c6317973f2021f04a4ae15c (diff) |
lbmk: unified execution on find commands
We have a lot of places in lbmk where the output of find is
used, and then some function is executed on the result.
This is messy, and bloats several of these functions.
Now this is unified, into a new function: fx_
What fx_ does is execute a given function, for each result
found, with the arguments for a find command appended.
For example:
find -name ".git"
If you wanted to do: foo "$arg"
Where "arg" is a search result from find, and you wanted
to execute "foo" on each one, you would do:
fx_ foo -name ".git"
The find utility does have an -exec feature, but I've found
that it only works for executables, not functions.
fx_ does not return errors, so "foo" in this example
would have to do its own error handling.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/init.sh')
0 files changed, 0 insertions, 0 deletions