mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -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;
|
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() {
|
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() {
|
ghc::filesystem::path dirs::getSaveDir() {
|
||||||
#ifdef GEODE_IS_MACOS
|
#ifdef GEODE_IS_MACOS
|
||||||
// not using ~/Library/Caches
|
// not using ~/Library/Caches
|
||||||
return ghc::filesystem::path("/Users/Shared/Geode");
|
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
|
#else
|
||||||
return ghc::filesystem::path(CCFileUtils::sharedFileUtils()->getWritablePath().c_str());
|
return weaklyCanonical(CCFileUtils::sharedFileUtils()->getWritablePath().c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue