mirror of
https://github.com/nmattia/niv.git
synced 2024-11-08 08:26:02 +03:00
parent
5d9e3a5f7d
commit
3891f80bf5
11
app/Niv.hs
11
app/Niv.hs
@ -58,6 +58,9 @@ newtype Sources = Sources
|
|||||||
|
|
||||||
getSources :: IO Sources
|
getSources :: IO Sources
|
||||||
getSources = do
|
getSources = do
|
||||||
|
exists <- Dir.doesFileExist pathNixSourcesJson
|
||||||
|
unless exists abortSourcesDoesntExist
|
||||||
|
|
||||||
warnIfOutdated
|
warnIfOutdated
|
||||||
-- TODO: if doesn't exist: run niv init
|
-- TODO: if doesn't exist: run niv init
|
||||||
putStrLn $ "Reading sources file"
|
putStrLn $ "Reading sources file"
|
||||||
@ -696,6 +699,14 @@ Make sure the repository exists.
|
|||||||
-- Abort
|
-- Abort
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
abortSourcesDoesntExist :: IO a
|
||||||
|
abortSourcesDoesntExist = abort $ unlines [ line1, line2 ]
|
||||||
|
where
|
||||||
|
line1 = "Cannot use " <> pathNixSourcesJson
|
||||||
|
line2 = [s|
|
||||||
|
The sources file does not exist! You may need to run 'niv init'.
|
||||||
|
|]
|
||||||
|
|
||||||
abortSourcesIsntAMap :: IO a
|
abortSourcesIsntAMap :: IO a
|
||||||
abortSourcesIsntAMap = abort $ unlines [ line1, line2 ]
|
abortSourcesIsntAMap = abort $ unlines [ line1, line2 ]
|
||||||
where
|
where
|
||||||
|
Loading…
Reference in New Issue
Block a user