diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-09-11 01:21:01 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-09-14 01:05:42 -0400 |
commit | 3a1d3aa8ec14d4250ba79b747e77b9d727e6eb5e (patch) | |
tree | 515aa57fe685e756ab8fda97077ad8a19e5cab57 /libs/tool | |
parent | b7ef70dad6de682541f4d27fea995b540121d0b2 (diff) | |
download | librebootfr-3a1d3aa8ec14d4250ba79b747e77b9d727e6eb5e.tar.gz librebootfr-3a1d3aa8ec14d4250ba79b747e77b9d727e6eb5e.zip |
Add function 'tool_arguments_targets' to libs/tool
This is essentially the same function from libs/project with only the
prefix changed from 'project_' to 'tool_' and minor formatting
changes.
The function had to be added in order to allow for arguments to tool
scripts, which the dependencies script will require.
Diffstat (limited to 'libs/tool')
-rwxr-xr-x | libs/tool | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -200,6 +200,25 @@ tool_action_arguments_recursive() { fi } +tool_arguments_targets() { + local tool="$1" + shift + + local tool_path="$(tool_path "${tool}")" + local targets_path="${tool_path}/${CONFIGS}" + local argument + + for argument in "$@"; do + targets_path="${targets_path}/${argument}" + done + + targets_path="${targets_path}/${TARGETS}" + + if [[ -f "${targets_path}" ]]; then + cat "${targets_path}" + fi +} + tool_path() { local tool=$1 |