MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / resolveHostToolPath

Function resolveHostToolPath

Tests/SCBuildTest/SCBuildFixtureTest.cpp:213–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211
212#if SC_PLATFORM_APPLE or SC_PLATFORM_LINUX
213static Result resolveHostToolPath(StringView toolName, String& toolPath)
214{
215 Process process;
216 String output = StringEncoding::Utf8;
217 SC_TRY(process.exec({"which", toolName}, output));
218 SC_TRY_MSG(process.getExitStatus() == 0, "Cannot locate host tool");
219 SC_TRY(toolPath.assign(StringView(output.view()).trimWhiteSpaces()));
220 return Result(true);
221}
222
223#if SC_PLATFORM_APPLE
224static bool tryResolveHostToolPath(StringView toolName, String& toolPath)

Callers 3

SCBuildFixtureTestMethod · 0.85

Calls 3

ResultClass · 0.50
assignMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected