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 ++ "/"
|
||||
|
||||
userLicenseDir :: IO String
|
||||
userLicenseDir = xdgConfigHome <&> (++ defaultUserLicenseDirName)
|
||||
userLicenseDir =
|
||||
xdgConfigHome <&> (normalizeDirectory . (++ defaultUserLicenseDirName))
|
||||
where
|
||||
xdgConfigHome :: IO String
|
||||
xdgConfigHome =
|
||||
(lookupEnv "XDG_CONFIG_HOME")
|
||||
>>= maybe userHomeDir (return . normalizeDirectory)
|
||||
xdgConfigHome = do
|
||||
xch <- lookupEnv "XDG_CONFIG_HOME"
|
||||
case xch of
|
||||
Just p@(_ : _) -> return $ normalizeDirectory p
|
||||
_ -> userHomeDir <&> (++ ".config/")
|
||||
|
||||
userHomeDir :: IO String
|
||||
userHomeDir = getEnv "HOME" <&> normalizeDirectory
|
||||
|
||||
Reference in New Issue
Block a user