aboutsummaryrefslogtreecommitdiff
path: root/libs/tool
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-09-11 01:21:01 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-09-14 01:05:42 -0400
commit3a1d3aa8ec14d4250ba79b747e77b9d727e6eb5e (patch)
tree515aa57fe685e756ab8fda97077ad8a19e5cab57 /libs/tool
parentb7ef70dad6de682541f4d27fea995b540121d0b2 (diff)
downloadlibrebootfr-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-xlibs/tool19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/tool b/libs/tool
index 03d2d508..8fa154ef 100755
--- a/libs/tool
+++ b/libs/tool
@@ -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