mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
make getGameDir weaklyCanonical
This commit is contained in:
parent
7af062f35d
commit
c174f81998
1 changed files with 13 additions and 8 deletions
|
@ -6,22 +6,27 @@
|
|||
|
||||
using namespace geode::prelude;
|
||||
|
||||
namespace {
|
||||
ghc::filesystem::path weaklyCanonical(ghc::filesystem::path const& path) {
|
||||
#ifdef GEODE_IS_WINDOWS
|
||||
// this is std::filesystem intentionally because ghc version doesnt want to work with softlinked directories
|
||||
return std::filesystem::weakly_canonical(path.string()).string();
|
||||
#else
|
||||
return ghc::filesystem::weakly_canonical(path.string()).string();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
ghc::filesystem::path dirs::getGameDir() {
|
||||
return ghc::filesystem::path(CCFileUtils::sharedFileUtils()->getWritablePath2().c_str());
|
||||
return weaklyCanonical(CCFileUtils::sharedFileUtils()->getWritablePath2().c_str());
|
||||
}
|
||||
|
||||
ghc::filesystem::path dirs::getSaveDir() {
|
||||
#ifdef GEODE_IS_MACOS
|
||||
// not using ~/Library/Caches
|
||||
return ghc::filesystem::path("/Users/Shared/Geode");
|
||||
#elif defined(GEODE_IS_WINDOWS)
|
||||
// this is std::filesystem intentionally because ghc version doesnt want to work with softlinked directories
|
||||
return ghc::filesystem::path(
|
||||
std::filesystem::weakly_canonical(CCFileUtils::sharedFileUtils()->getWritablePath().c_str())
|
||||
.string()
|
||||
);
|
||||
#else
|
||||
return ghc::filesystem::path(CCFileUtils::sharedFileUtils()->getWritablePath().c_str());
|
||||
return weaklyCanonical(CCFileUtils::sharedFileUtils()->getWritablePath().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue