# shellcheck shell=bash

# TODO: ... or cygwin
if [ -n "$MSYS" ]; then
___x_cmd_path_obj_unshift_(){
    local pathdata="${1}"
    local dir="${2:?Provide a directory}"

    case "$dir" in
        *:/*)
            dir="/${dir%%:/*}/${dir#*:/}"
            x:warn "Path provided is windows style, transform to unix style: ${dir}"
    esac

    if [ -z "$pathdata" ]; then         x_="${dir}"
    else                                x_="${dir}:${pathdata}"
    fi
}
else

___x_cmd_path_obj_unshift_(){
    local pathdata="${1}"
    local dir="${2:?Provide a directory}"

    if [ -z "$pathdata" ]; then         x_="${dir}"
    else                                x_="${dir}:${pathdata}"
    fi
}
fi

___x_cmd_path_obj_unshift(){
    local x_=""
    ___x_cmd_path_obj_unshift_ "$@" || return $?
    printf "%s\n" "$x_"
}
