cellar/src/launch/launch.cpp

36 lines
856 B
C++
Raw Normal View History

2017-03-23 21:20:26 -07:00
#include <string>
#include <vector>
#include <unistd.h>
#include <boost/algorithm/string/join.hpp>
#include "subprocess.hpp"
#include "launch.hpp"
#include "internal/launch.hpp"
#include "output.hpp"
using namespace std;
using namespace cellar;
void cellar::launch::launch_program(vector<string> args) {
vector<string> wineargs = args;
wineargs[0] = "wine";
2017-03-27 16:14:04 -07:00
2017-03-23 21:20:26 -07:00
string winelaunch = boost::algorithm::join(wineargs, " ");
2017-03-27 16:14:04 -07:00
launch::popen(winelaunch);
2017-03-23 21:20:26 -07:00
}
void cellar::launch::launch_command(int argc, vector<string> args) {
if (argc == 1) {
output::error("forgot to specify a command");
return;
}
launch::launch_program(args);
}
2017-03-27 16:14:04 -07:00
// BULLSHIT: subprocess.hpp throws linker errors if included in multiple files
void cellar::launch::popen(string argv) {
auto wine = subprocess::Popen(argv);
wine.wait();
}