#!/usr/bin/env bash

ORIGIN="$(dirname "$0")"

if command -v python &> /dev/null
then
    python="python"
elif command -v python3 &> /dev/null
then
    python="python3"
elif command -v python2 &> /dev/null
then
    python="python2"
else
    echo "Python not found." >&2
    exit 1
fi

for script in "${ORIGIN}/latest_version.d/"*.py
do
    module="$(basename "$script")"
    module="${module%.py}"
    echo "${module}_src='$($python $script)'"
done
