forked from tastytea/libravatarserv
Changed environment variable AVATAR_DIR to LIBRAVATARSERV_DIR to avoid collisions.
AVATAR_DIR is still supported until 1.0.0 for backwards-compatibility.
This commit is contained in:
parent
653499be95
commit
13a71f0315
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.2)
|
||||
project(libravatarserv
|
||||
VERSION 0.3.0
|
||||
VERSION 0.3.1
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ HTTPS.
|
|||
|
||||
libravatarserv looks in each of `${XDG_DATA_DIRS}` for a directory named
|
||||
`libravatarserv`. You can force a different directory by setting the environment
|
||||
variable `${AVATAR_DIR}`.
|
||||
variable `${LIBRAVATARSERV_DIR}` (until 0.3.0 `${AVATAR_DIR}`).
|
||||
|
||||
The image files are named like your email address, no file extension. If you
|
||||
want to deliver a default image for unknown email addresses, name it `default`.
|
||||
|
|
|
@ -83,17 +83,16 @@ int main()
|
|||
|
||||
bool find_avatar_dir()
|
||||
{
|
||||
const char *envdir = std::getenv("AVATAR_DIR");
|
||||
if (envdir != nullptr)
|
||||
const char *envdir = std::getenv("LIBRAVATARSERV_DIR");
|
||||
if (envdir == nullptr)
|
||||
{
|
||||
if (fs::is_directory(envdir))
|
||||
{
|
||||
avatar_dir = envdir;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// TODO: Remove AVATAR_DIR in 1.0.0
|
||||
// DEPRECATED because it is potentially used by another program
|
||||
envdir = std::getenv("AVATAR_DIR");
|
||||
}
|
||||
if (envdir != nullptr && fs::is_directory(envdir))
|
||||
{
|
||||
avatar_dir = envdir;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue