Commit de2fbfaa authored by's avatar
Browse files

Create .cabal directory before writing .cabal/config

parent 68d342f0
......@@ -35,6 +35,7 @@ import Data.List (intersperse)
import Data.Maybe (mapMaybe, fromMaybe)
import System.Directory (Permissions (..), getPermissions, createDirectoryIfMissing
import System.FilePath (takeDirectory)
import System.IO.Error (isDoesNotExistError)
import System.IO (hPutStrLn, stderr)
import System.IO.Unsafe
......@@ -203,7 +204,8 @@ loadConfig configFile =
-- FIXME: finish this
writeDefaultConfigFile :: FilePath -> ConfigFlags -> IO ()
writeDefaultConfigFile file cfg =
writeFile file $ showFields configWriteFieldDescrs cfg
do createDirectoryIfMissing True (takeDirectory file)
writeFile file $ showFields configWriteFieldDescrs cfg
-- | All config file fields.
configFieldDescrs :: [FieldDescr ConfigFlags]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment