launch::popen respects dry run flag (#27)
This commit is contained in:
parent
e735768e52
commit
96ccab40f7
@ -6,6 +6,7 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include "subprocess.hpp"
|
||||
|
||||
#include "cellar.hpp"
|
||||
#include "bottles.hpp"
|
||||
#include "launch.hpp"
|
||||
#include "internal/launch.hpp"
|
||||
@ -48,6 +49,7 @@ void cellar::launch::popen(string argv) {
|
||||
|
||||
void cellar::launch::popen(vector<string> argv) {
|
||||
output::statement("launching program: " + boost::algorithm::join(argv, " "), true);
|
||||
if (!dryrun) {
|
||||
string exec = argv[0];
|
||||
vector<string> subargv;
|
||||
for (int curarg = 1; curarg < argv.size(); curarg++) {
|
||||
@ -56,4 +58,5 @@ void cellar::launch::popen(vector<string> argv) {
|
||||
auto subproc = subprocess::popen(exec, subargv);
|
||||
cout << subproc.stdout().rdbuf();
|
||||
cerr << subproc.stderr().rdbuf();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user