tools/run_versions.sh

22 lines
445 B
Bash
Raw Permalink Normal View History

2020-07-07 16:04:12 +00:00
#! /usr/bin/env bash
# Args: <source> <version> <script> <args...>
2020-07-14 02:36:48 +00:00
VERSION_ARGS=()
2020-07-07 16:04:12 +00:00
if [ -z "$VERSIONS_OUT" ]
then
VERSIONS_OUT=".sources"
fi
2020-07-14 02:36:48 +00:00
VERSION_ARGS=("${VERSION_ARGS[@]}" "-f" "$VERSIONS_OUT")
if [ -n "$VERSIONS_NAMES" ]
then
VERSION_ARGS=("${VERSION_ARGS[@]}" "-n" "$VERSIONS_NAMES")
fi
2020-07-07 16:04:12 +00:00
mkdir -p ".sources" &&
while read i
do
"$3" "$i" "${@:4}" || exit "$?"
2020-07-14 02:36:48 +00:00
done < <("$(dirname "$0")/versions.py" -L "${VERSION_ARGS[@]}" "$1" "$2")