Fix overriding

This commit is contained in:
2026-04-25 02:51:00 -07:00
parent d10ed0daab
commit a46a008735

View File

@@ -71,12 +71,15 @@ normalizeDirectory :: String -> String
normalizeDirectory s = if "/" `isSuffixOf` s then s else s ++ "/" normalizeDirectory s = if "/" `isSuffixOf` s then s else s ++ "/"
userLicenseDir :: IO String userLicenseDir :: IO String
userLicenseDir = xdgConfigHome <&> (++ defaultUserLicenseDirName) userLicenseDir =
xdgConfigHome <&> (normalizeDirectory . (++ defaultUserLicenseDirName))
where where
xdgConfigHome :: IO String xdgConfigHome :: IO String
xdgConfigHome = xdgConfigHome = do
(lookupEnv "XDG_CONFIG_HOME") xch <- lookupEnv "XDG_CONFIG_HOME"
>>= maybe userHomeDir (return . normalizeDirectory) case xch of
Just p@(_ : _) -> return $ normalizeDirectory p
_ -> userHomeDir <&> (++ ".config/")
userHomeDir :: IO String userHomeDir :: IO String
userHomeDir = getEnv "HOME" <&> normalizeDirectory userHomeDir = getEnv "HOME" <&> normalizeDirectory