Skip to content

Commit 058c36b

Browse files
committed
bugfix: check for $AMIBERRY_HOME_DIR before the last fallback
When checking for the plugins directory, we should also include the check for $AMIBERRY_HOME_DIR in case it's specified, before falling back to user's $HOME.
1 parent d284e78 commit 058c36b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/osdep/amiberry.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4151,7 +4151,14 @@ std::string get_plugins_directory(bool portable_mode)
41514151
write_log("Using plugins directory from " AMIBERRY_LIBDIR "\n");
41524152
return AMIBERRY_LIBDIR;
41534153
}
4154-
// 3: Check for ~/Amiberry-Lite/plugins
4154+
// 3: Check for $AMIBERRY_HOME_DIR/plugins
4155+
const auto env_home_dir = getenv("AMIBERRY_HOME_DIR");
4156+
if (env_home_dir != nullptr && my_existsdir(env_home_dir))
4157+
{
4158+
write_log("Using plugins directory from AMIBERRY_HOME_DIR/plugins\n");
4159+
return { std::string(env_home_dir) + "/plugins" };
4160+
}
4161+
// 4: Check for ~/Amiberry-Lite/plugins
41554162
const auto user_home_dir = getenv("HOME");
41564163
if (user_home_dir != nullptr)
41574164
{

0 commit comments

Comments
 (0)