Merge pull request #11713 from ethereum/better-error-for-non-existent-base-path

Better error message when base path does not exist
This commit is contained in:
chriseth 2021-07-28 08:44:53 +02:00 committed by GitHub
commit 1794e1c837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,10 +383,19 @@ bool CommandLineInterface::readInputFiles()
m_fileReader.setBasePath(m_options.input.basePath);
if (m_fileReader.basePath() != "" && !boost::filesystem::is_directory(m_fileReader.basePath()))
if (m_fileReader.basePath() != "")
{
serr() << "Base path must be a directory: " << m_fileReader.basePath() << endl;
return false;
if (!boost::filesystem::exists(m_fileReader.basePath()))
{
serr() << "Base path does not exist: " << m_fileReader.basePath() << endl;
return false;
}
if (!boost::filesystem::is_directory(m_fileReader.basePath()))
{
serr() << "Base path is not a directory: " << m_fileReader.basePath() << endl;
return false;
}
}
for (boost::filesystem::path const& allowedDirectory: m_options.input.allowedDirectories)