MCPcopy Create free account
hub / github.com/ByConity/ByConity / executeScript

Function executeScript

programs/install/Install.cpp:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76namespace fs = std::filesystem;
77
78static auto executeScript(const std::string & command, bool throw_on_error = false)
79{
80 auto sh = ShellCommand::execute(command);
81 WriteBufferFromFileDescriptor wb_stdout(STDOUT_FILENO);
82 WriteBufferFromFileDescriptor wb_stderr(STDERR_FILENO);
83 copyData(sh->out, wb_stdout);
84 copyData(sh->err, wb_stderr);
85
86 if (throw_on_error)
87 {
88 sh->wait();
89 return 0;
90 }
91 else
92 return sh->tryWait();
93}
94
95static bool filesEqual(std::string path1, std::string path2)
96{

Callers 2

startFunction · 0.85

Calls 4

tryWaitMethod · 0.80
executeFunction · 0.50
copyDataFunction · 0.50
waitMethod · 0.45

Tested by

no test coverage detected