Caching bin path
This commit is contained in:
parent
0ab009e17a
commit
cf13499158
|
@ -11,6 +11,7 @@ using boost::filesystem::path;
|
|||
using std::string;
|
||||
|
||||
path getBinPath() {
|
||||
static const path binPath = [] {
|
||||
try {
|
||||
// Determine path length
|
||||
int pathLength = wai_getExecutablePath(nullptr, 0, nullptr);
|
||||
|
@ -32,8 +33,10 @@ path getBinPath() {
|
|||
static path binPath(boost::filesystem::canonical(pathString).make_preferred());
|
||||
return binPath;
|
||||
} catch (...) {
|
||||
std::throw_with_nested(std::runtime_error("Could not determine path of bin directory.") );
|
||||
std::throw_with_nested(std::runtime_error("Could not determine path of bin directory."));
|
||||
}
|
||||
}();
|
||||
return binPath;
|
||||
}
|
||||
|
||||
path getBinDirectory() {
|
||||
|
|
Loading…
Reference in New Issue