std::string get_version()

in include/poac/core/naming.hpp [129:150]


    std::string get_version(const YAML::Node& node, const std::string& src)
    {
        namespace yaml = io::file::yaml;

        if (src == "github") {
            if (const auto ver = yaml::get<std::string>(node)) {
                return *ver;
            }
            else if (const auto ver2 = yaml::get<std::string>(node, "tag")) {
                return *ver2;
            }
        }
        else if (src == "poac") {
            if (const auto ver = yaml::get<std::string>(node)) {
                return *ver;
            }
            else if (const auto ver2 = yaml::get<std::string>(node, "version")) {
                return *ver2;
            }
        }
        throw exception::error(err::source(src));
    }