cellar launch now reads and respects wine-path setting (fixes #23)

This commit is contained in:
Nicholas O'Connor 2017-06-09 12:16:59 -07:00
parent 58c96411a0
commit d789416c5f
2 changed files with 7 additions and 3 deletions

View File

@ -57,8 +57,7 @@ void cellar::config::config_command(int argc, vector<string> argv) {
return; return;
} }
string key = argv[2]; string newvalue = value;
string newvalue = argv[3];
string oldvalue = active_bottle.get_config(key); string oldvalue = active_bottle.get_config(key);
if (active_bottle.set_config(key, newvalue)) { if (active_bottle.set_config(key, newvalue)) {

View File

@ -6,6 +6,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include "subprocess.hpp" #include "subprocess.hpp"
#include "bottles.hpp"
#include "launch.hpp" #include "launch.hpp"
#include "internal/launch.hpp" #include "internal/launch.hpp"
#include "output.hpp" #include "output.hpp"
@ -14,7 +15,11 @@ using namespace std;
using namespace cellar; using namespace cellar;
void cellar::launch::launch_program(vector<string> args) { void cellar::launch::launch_program(vector<string> args) {
args[0] = "wine"; string winepath = bottles::active_bottle.get_config("wine-path");
if (winepath == "") { winepath = "wine"; } // lets assume wine is in PATH if there's no config for it
// TODO: better support for compiled in defaults (cogrc?)
args[0] = winepath;
launch::popen(args); launch::popen(args);
} }