mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 12:10:59 +01:00
before merging executeAndPrintShellCommand to runProgram
This commit is contained in:
parent
1c0b052243
commit
729933062b
2 changed files with 15 additions and 0 deletions
|
|
@ -1069,6 +1069,18 @@ string trim(const string & s) {
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
string runProgram_AndPrintOutput(Path program, bool searchPath, const Strings & args, const string outputPrefix)
|
||||||
|
{
|
||||||
|
string program_output = runProgram(program, true, args);
|
||||||
|
|
||||||
|
//Add the prefix on every line
|
||||||
|
//TODO
|
||||||
|
|
||||||
|
//Remove the trailing \n
|
||||||
|
size_t found = program_output.find_last_of("\n");
|
||||||
|
printMsg(lvlError, format("%1%") % program_output.substr(0,found));
|
||||||
|
}
|
||||||
|
|
||||||
void executeAndPrintShellCommand(const string & command, const string & commandName, const bool & captureOutput)
|
void executeAndPrintShellCommand(const string & command, const string & commandName, const bool & captureOutput)
|
||||||
{
|
{
|
||||||
///////////////////////
|
///////////////////////
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,9 @@ string trim(const string & s);
|
||||||
//excecute a shell command
|
//excecute a shell command
|
||||||
void executeAndPrintShellCommand(const string & command, const string & commandName, const bool & captureOutput);
|
void executeAndPrintShellCommand(const string & command, const string & commandName, const bool & captureOutput);
|
||||||
|
|
||||||
|
//
|
||||||
|
string runProgram_AndPrintOutput(Path program, bool searchPath, const Strings & args, const string outputPrefix);
|
||||||
|
|
||||||
//Convert time_t to a string
|
//Convert time_t to a string
|
||||||
string time_t2string(const time_t & t);
|
string time_t2string(const time_t & t);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue