summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-05-13 16:32:28 -0300
committerTomás Touceda <chiiph@leap.se>2014-05-13 16:32:28 -0300
commitffc7b0eeb5d77b0fcd45ce44f4ebf3256ca4e8fb (patch)
treecdc890b990002c3b1874ebda94b4a03c72a611b3
parent98ecb0421d8f5cc2f1420ad39c514315fd048118 (diff)
Properly calculate the bundle directory
-rw-r--r--src/main.cpp10
1 files 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