Skip to content

Commit

Permalink
Merge branch 'gz-fuel-tools8' into nkoenig/configure-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoenig authored Apr 9, 2024
2 parents 97f4ba6 + 6cbce88 commit 4dc704a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/ClientConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,24 @@ ClientConfig::ClientConfig() : dataPtr(new ClientConfigPrivate)
<< "to set cache path. Please use [GZ_FUEL_CACHE_PATH] instead."
<< std::endl;
}
else
{
return;
}
}

if (!gz::common::isDirectory(gzFuelPath))
if (!gzFuelPath.empty())
{
gzerr << "[" << gzFuelPath << "] is not a directory" << std::endl;
return;
if (!gz::common::isDirectory(gzFuelPath))
gzerr << "[" << gzFuelPath << "] is not a directory" << std::endl;
else
this->SetCacheLocation(gzFuelPath);
}
this->SetCacheLocation(gzFuelPath);

std::string configYamlFile = common::joinPaths(this->CacheLocation(),
"config.yaml");
std::string configYmlFile = common::joinPaths(this->CacheLocation(),
"config.yml");
if (gz::common::exists(configYamlFile))
this->LoadConfig(configYamlFile);
else if (gz::common::exists(configYmlFile))
this->LoadConfig(configYmlFile);
}

//////////////////////////////////////////////////
Expand Down

0 comments on commit 4dc704a

Please sign in to comment.