diff options
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r-- | src/buildtool/main/main.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index e3c1385a..4c977955 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -1160,32 +1160,28 @@ void ReportTaintedness(const AnalysisResult& result) { [[nodiscard]] auto FetchAndInstallArtifacts( gsl::not_null<IExecutionApi*> const& api, FetchArguments const& clargs) -> bool { - auto object_info = Artifact::ObjectInfo::FromString(clargs.object_id); - if (not object_info) { - Logger::Log( - LogLevel::Error, "failed to parse object id {}.", clargs.object_id); - return false; - } + auto object_info = + Artifact::ObjectInfo::LiberalFromString(clargs.object_id); if (clargs.output_path) { auto output_path = (*clargs.output_path / "").parent_path(); if (FileSystemManager::IsDirectory(output_path)) { - output_path /= object_info->digest.hash(); + output_path /= object_info.digest.hash(); } if (not FileSystemManager::CreateDirectory(output_path.parent_path()) or - not api->RetrieveToPaths({*object_info}, {output_path})) { + not api->RetrieveToPaths({object_info}, {output_path})) { Logger::Log(LogLevel::Error, "failed to retrieve artifact."); return false; } Logger::Log(LogLevel::Info, "artifact {} was installed to {}", - object_info->ToString(), + object_info.ToString(), output_path.string()); } else { // dump to stdout - if (not api->RetrieveToFds({*object_info}, {dup(fileno(stdout))})) { + if (not api->RetrieveToFds({object_info}, {dup(fileno(stdout))})) { Logger::Log(LogLevel::Error, "failed to dump artifact."); return false; } |