From ffc7b0eeb5d77b0fcd45ce44f4ebf3256ca4e8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Tue, 13 May 2014 16:32:28 -0300 Subject: Properly calculate the bundle directory --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 66abb12..78aba3a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -94,14 +94,14 @@ mergeDirectories(const fs::path &source, } void -updateIfNeeded() +updateIfNeeded(fs::path &full_path) { - fs::path updatePath(fs::current_path() / fs::path(UPDATES_DIR)); + fs::path updatePath(full_path / fs::path(UPDATES_DIR)); if (fs::exists(updatePath)) { std::cout << "Found updates, merging directories before doing anything..." << std::endl; - mergeDirectories(updatePath, fs::current_path()); + mergeDirectories(updatePath, full_path); fs::remove_all(updatePath); } else @@ -115,9 +115,9 @@ int main(int argc, char** argv) { try { - fs::path full_path(fs::current_path()); + fs::path full_path(fs::system_complete(argv[0]).parent_path()); - updateIfNeeded(); + updateIfNeeded(full_path); auto pypath = full_path.string() + "/apps/:" + full_path.string() + "/lib/"; std::cout << pypath << std::endl; #if not defined _WIN32 && not defined _WIN64 -- cgit v1.2.3