22 lines
445 B
Bash
22 lines
445 B
Bash
#! /usr/bin/env bash
|
|
# Args: <source> <version> <script> <args...>
|
|
|
|
VERSION_ARGS=()
|
|
|
|
if [ -z "$VERSIONS_OUT" ]
|
|
then
|
|
VERSIONS_OUT=".sources"
|
|
fi
|
|
VERSION_ARGS=("${VERSION_ARGS[@]}" "-f" "$VERSIONS_OUT")
|
|
|
|
if [ -n "$VERSIONS_NAMES" ]
|
|
then
|
|
VERSION_ARGS=("${VERSION_ARGS[@]}" "-n" "$VERSIONS_NAMES")
|
|
fi
|
|
|
|
mkdir -p ".sources" &&
|
|
while read i
|
|
do
|
|
"$3" "$i" "${@:4}" || exit "$?"
|
|
done < <("$(dirname "$0")/versions.py" -L "${VERSION_ARGS[@]}" "$1" "$2")
|