Fix config path resolution on Windows
This commit is contained in:
parent
37bc4e87b3
commit
6588363fa3
@ -76,17 +76,10 @@ std::string config::location()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MUSIQUE_WINDOWS
|
#ifdef MUSIQUE_WINDOWS
|
||||||
wchar_t *resultPath = nullptr;
|
|
||||||
SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &resultPath);
|
|
||||||
auto const len = std::strlen((char*)resultPath);
|
|
||||||
if (!resultPath && len < 3) {
|
|
||||||
auto drive = getenv("HOMEDRIVE");
|
auto drive = getenv("HOMEDRIVE");
|
||||||
auto path = getenv("HOMEPATH");
|
auto path = getenv("HOMEPATH");
|
||||||
ensure(drive && path, "Windows failed to provide HOMEDRIVE & HOMEPATH variables");
|
ensure(drive && path, "Windows failed to provide HOMEDRIVE & HOMEPATH variables");
|
||||||
return std::string(drive) + std::string(path) + "\\Documents\\musique.conf";
|
return std::string(drive) + std::string(path) + "\\Documents\\musique.conf";
|
||||||
}
|
|
||||||
|
|
||||||
return std::string((char*)resultPath, len) + "\\musique.conf";
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MUSIQUE_DARWIN
|
#ifdef MUSIQUE_DARWIN
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Release is defined as a zip archive containing source code,
|
# Release is defined as a zip archive containing source code,
|
||||||
# build binaries for supported platforms and build documentation
|
# build binaries for supported platforms and build documentation
|
||||||
|
|
||||||
set -e -o pipefail
|
set -xe -o pipefail
|
||||||
|
|
||||||
Suffix="$(date +"%Y-%m-%d")"
|
Suffix="$(date +"%Y-%m-%d")"
|
||||||
Target="release_$Suffix"
|
Target="release_$Suffix"
|
||||||
|
Loading…
Reference in New Issue
Block a user