ignore non-directory path in dependency-info-tool

This commit is contained in:
Onha Choe 2016-12-12 12:05:52 -08:00 committed by onhachoe
parent 44c0681afb
commit 0e7eaa08f9

View File

@ -162,6 +162,11 @@ LoadDependencyInfo(Filesystem const *filesystem, std::string const &path, depend
dependencyInfo->push_back(binaryInfo->dependencyInfo());
return true;
} else if (format == dependency::DependencyInfoFormat::Directory) {
if (filesystem->type(path) != Filesystem::Type::Directory) {
fprintf(stderr, "warning: ignoring non-directory %s\n", path.c_str());
return true;
}
auto directoryInfo = dependency::DirectoryDependencyInfo::Deserialize(filesystem, path);
if (!directoryInfo) {
fprintf(stderr, "error: invalid directory\n");