From 3a1d3aa8ec14d4250ba79b747e77b9d727e6eb5e Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Mon, 11 Sep 2017 01:21:01 -0400 Subject: 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. --- libs/tool | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libs/tool') 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 -- cgit v1.2.3-70-g09d2