From 6588363fa30d1e41e97fc8dad14b50f826b1cae5 Mon Sep 17 00:00:00 2001 From: Robert Bendun Date: Mon, 2 Jan 2023 06:41:58 +0100 Subject: [PATCH] Fix config path resolution on Windows --- musique/config.cc | 15 ++++----------- scripts/release | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/musique/config.cc b/musique/config.cc index 6065de4..c28d29e 100644 --- a/musique/config.cc +++ b/musique/config.cc @@ -76,17 +76,10 @@ std::string config::location() #endif #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 path = getenv("HOMEPATH"); - ensure(drive && path, "Windows failed to provide HOMEDRIVE & HOMEPATH variables"); - return std::string(drive) + std::string(path) + "\\Documents\\musique.conf"; - } - - return std::string((char*)resultPath, len) + "\\musique.conf"; + auto drive = getenv("HOMEDRIVE"); + auto path = getenv("HOMEPATH"); + ensure(drive && path, "Windows failed to provide HOMEDRIVE & HOMEPATH variables"); + return std::string(drive) + std::string(path) + "\\Documents\\musique.conf"; #endif #ifdef MUSIQUE_DARWIN diff --git a/scripts/release b/scripts/release index 5b08066..664af59 100755 --- a/scripts/release +++ b/scripts/release @@ -4,7 +4,7 @@ # Release is defined as a zip archive containing source code, # build binaries for supported platforms and build documentation -set -e -o pipefail +set -xe -o pipefail Suffix="$(date +"%Y-%m-%d")" Target="release_$Suffix"