From 3726e51c4ad7c7c85b99f50aa94149df3be52fc9 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Wed, 23 Oct 2013 23:23:42 +0300 Subject: [PATCH] [mac] Symlinks to data dir are not necessary during development with omim repo --- platform/platform_mac.mm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/platform/platform_mac.mm b/platform/platform_mac.mm index 9b1710b732..fcbdc6d081 100644 --- a/platform/platform_mac.mm +++ b/platform/platform_mac.mm @@ -26,6 +26,13 @@ Platform::Platform() { // we're the console app, probably unit test, and path is our directory m_resourcesDir = bundlePath + "/../../data/"; + if (!IsFileExistsByFullPath(m_resourcesDir)) + { + // Check development environment without symlink but with git repo + string const repoPath = bundlePath + "/../../../omim/data/"; + if (IsFileExistsByFullPath(repoPath)) + m_resourcesDir = repoPath; + } m_writableDir = m_resourcesDir; } else @@ -33,12 +40,17 @@ Platform::Platform() m_resourcesDir = resourcesPath + "/"; // get writable path -#ifndef OMIM_PRODUCTION // developers can have symlink to data folder char const * dataPath = "../../../../../data/"; if (IsFileExistsByFullPath(m_resourcesDir + dataPath)) m_writableDir = m_resourcesDir + dataPath; -#endif + else + { + // Check development environment without symlink but with git repo + dataPath = "../../../../../../omim/data/"; + if (IsFileExistsByFullPath(m_resourcesDir + dataPath)) + m_writableDir = m_resourcesDir + dataPath; + } if (m_writableDir.empty()) {