Fix overriding
This commit is contained in:
11
src/Main.hs
11
src/Main.hs
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user