Fix fontconfig path typo to fix FileNotFoundError on Linux

This commit is contained in:
oyaah
2026-06-07 01:49:50 +05:30
parent cf6ad2e9b0
commit fafd35a775
+2 -2
View File
@@ -103,14 +103,14 @@ def get_env_vars(
if OS_NAME == 'lin':
# https://github.com/coryking/camoufox/commit/f21eeb2850a74cc104fb57e17e0a2fa27b7a2a28
# Thanks @coryking
# the user_agent_os is either 'lin', 'mac', or 'win' but our fontconfigs directory is 'linux', 'macos', or 'windows'
# the user_agent_os is either 'lin', 'mac', or 'win' but our fontconfig directory is 'linux', 'macos', or 'windows'
directory_map = {
'lin': 'linux',
'mac': 'macos',
'win': 'windows',
}
os_dir = directory_map.get(user_agent_os, user_agent_os)
fontconfig_path = get_path(os.path.join("fontconfigs", os_dir))
fontconfig_path = get_path(os.path.join("fontconfig", os_dir))
# assert that fonts.conf exists in the directory
if not os.path.exists(os.path.join(fontconfig_path, "fonts.conf")):