mirror of
https://github.com/nmattia/niv.git
synced 2024-11-22 11:53:07 +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 = do
|
||||
exists <- Dir.doesFileExist pathNixSourcesJson
|
||||
unless exists abortSourcesDoesntExist
|
||||
|
||||
warnIfOutdated
|
||||
-- TODO: if doesn't exist: run niv init
|
||||
putStrLn $ "Reading sources file"
|
||||
@ -696,6 +699,14 @@ Make sure the repository exists.
|
||||
-- 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 = abort $ unlines [ line1, line2 ]
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user