From d789416c5f8e143f5261f39456916f0ba7896b89 Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Fri, 9 Jun 2017 12:16:59 -0700 Subject: [PATCH] cellar launch now reads and respects wine-path setting (fixes #23) --- src/config/cli_handler.cpp | 3 +-- src/launch/launch.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/config/cli_handler.cpp b/src/config/cli_handler.cpp index 2168078..8fc30b9 100644 --- a/src/config/cli_handler.cpp +++ b/src/config/cli_handler.cpp @@ -57,8 +57,7 @@ void cellar::config::config_command(int argc, vector argv) { return; } - string key = argv[2]; - string newvalue = argv[3]; + string newvalue = value; string oldvalue = active_bottle.get_config(key); if (active_bottle.set_config(key, newvalue)) { diff --git a/src/launch/launch.cpp b/src/launch/launch.cpp index 9d03e86..c17f809 100644 --- a/src/launch/launch.cpp +++ b/src/launch/launch.cpp @@ -6,6 +6,7 @@ #include #include "subprocess.hpp" +#include "bottles.hpp" #include "launch.hpp" #include "internal/launch.hpp" #include "output.hpp" @@ -14,7 +15,11 @@ using namespace std; using namespace cellar; void cellar::launch::launch_program(vector 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); }