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

Function executeScript

programs/install/Install.cpp:108–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107
108static auto executeScript(const std::string & command, bool throw_on_error = false)
109{
110 auto sh = ShellCommand::execute(command);
111
112 WriteBufferFromFileDescriptor wb_stdout(STDOUT_FILENO);
113 copyData(sh->out, wb_stdout);
114 wb_stdout.finalize();
115
116 WriteBufferFromFileDescriptor wb_stderr(STDERR_FILENO);
117 copyData(sh->err, wb_stderr);
118 wb_stderr.finalize();
119
120 if (throw_on_error)
121 {
122 sh->wait();
123 return 0;
124 }
125
126 return sh->tryWait();
127}
128
129static bool filesEqual(std::string path1, std::string path2)
130{

Callers 5

changeOwnershipFunction · 0.85
createGroupFunction · 0.85
createUserFunction · 0.85
Install.cppFile · 0.85
startFunction · 0.85

Calls 5

executeFunction · 0.85
copyDataFunction · 0.85
finalizeMethod · 0.45
waitMethod · 0.45
tryWaitMethod · 0.45

Tested by

no test coverage detected