Skip to content

Commit

Permalink
making scheme downloader case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
will-rowe committed Dec 2, 2020
1 parent 822d069 commit 9853231
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions artic/primerSchemeDownloader.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
Expand Down Expand Up @@ -107,11 +108,11 @@ void artic::DownloadScheme(SchemeArgs& args)
for (const auto& alias : scheme.second.get_child("aliases"))
{
checkedAliases.push_back(alias.second.data());
if (checkedAliases.back() != args.schemeName)
if (!boost::iequals(checkedAliases.back(), args.schemeName))
continue;

// check available versions and get the primer_url
LOG_TRACE("\tfound requested scheme:\t{} (using alias {})", scheme.first, checkedAliases.back());
LOG_TRACE("\tfound requested scheme:\t{} (using alias {})", scheme.first, args.schemeName);
unsigned int latestVersion = scheme.second.get<unsigned int>("latest_version");
if (args.schemeVersion > latestVersion)
{
Expand All @@ -131,7 +132,7 @@ void artic::DownloadScheme(SchemeArgs& args)
if (primer_url.first.empty() || reference_url.first.empty())
{
LOG_WARN("\tscheme not found:\t{}", args.schemeName);
LOG_WARN("listing available scheme aliases", args.schemeName);
LOG_WARN("listing available scheme aliases (case insensitive)", args.schemeName);
for (const auto& i : checkedAliases)
LOG_WARN("\t- {}", i);
throw std::runtime_error("no primer scheme available for " + args.schemeName);
Expand Down

0 comments on commit 9853231

Please sign in to comment.