#!/usr/bin/env bash

set -x
export CMD_PATH=$(cd `dirname $0`; pwd)
export PROJECT_NAME="${CMD_PATH##*/}"
echo $PROJECT_NAME
echo "FAMILY_ID $FAMILY_ID"

if [ -f /etc/os-release ]; then
    . /etc/os-release
    if [[ "$ID" == "almalinux" ]]; then
        source /ci/*run-on-almalinux.sh
    elif [[ "$ID" == "arch" ]]; then
        source /ci/*run-on-archlinux.sh
    elif [[ "$ID" == "debian" ]]; then
        source /ci/*run-on-debian.sh
    elif [[ "$ID" == "devuan" ]]; then
        source /ci/*run-on-devuan.sh
    elif [[ "$ID" == "fedora" ]]; then
        source /ci/*run-on-fedora.sh
    elif [[ "$ID" == "manjaro" ]]; then
        source /ci/*run-on-manjaro.sh
    elif [[ "$ID" == "opensuse-tumbleweed" ]]; then
        source /ci/*run-on-opensuse.sh
    elif [[ "$ID" == "rocky" ]]; then
        source /ci/run-on-rockylinux.sh
    elif [[ "$ID" == "ubuntu" ]]; then
        source /ci/*run-on-ubuntu.sh
    else
        if [[ "$FAMILY_ID" == "debian" ]]; then
            source /ci/*run-on-debian.sh
        fi
    fi
fi
