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

Function writeToolWrapperScript

Tests/SCBuildTest/SCBuildFixtureTest.cpp:248–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246#endif
247
248static Result writeToolWrapperScript(FileSystem& fs, StringView scriptPath, StringView logPath, StringView toolPath)
249{
250 String scriptContents = StringEncoding::Utf8;
251 SC_TRY(StringBuilder::format(scriptContents,
252 "#!/bin/sh\n"
253 "printf '%s\\n' \"$*\" >> \"{}\"\n"
254 "exec \"{}\" \"$@\"\n",
255 logPath, toolPath));
256 SC_TRY(fs.writeString(scriptPath, scriptContents.view()));
257 SC_TRY(fs.chmod(scriptPath, 0755u));
258 return Result(true);
259}
260
261static Result writeNoisyToolWrapperScript(FileSystem& fs, StringView scriptPath, StringView logPath,
262 StringView toolPath, StringView stdOutText, StringView stdErrText)

Callers 1

SCBuildFixtureTestMethod · 0.85

Calls 5

formatFunction · 0.50
ResultClass · 0.50
writeStringMethod · 0.45
viewMethod · 0.45
chmodMethod · 0.45

Tested by

no test coverage detected