1
1
mirror of https://github.com/nmattia/niv.git synced 2024-12-01 15:56:03 +03:00

Print INFO on init with custom sources.json

This commit is contained in:
Nicolas Mattia 2019-12-08 20:37:35 +01:00
parent ceab2e1572
commit 8d83a8dc9d

View File

@ -146,6 +146,22 @@ cmdInit = do
] $ \(path, onCreate, onUpdate) -> do
exists <- liftIO $ Dir.doesFileExist path
if exists then liftIO (B.readFile path) >>= onUpdate path else onCreate path
case fsj of
Auto -> pure ()
AtPath fp ->
tsay $ T.unlines
[ T.unwords
[ tbold $ tblue "INFO:"
, "You are using a custom path for sources.json."
]
, " You need to configure the sources.nix to use " <> tbold (T.pack fp) <> ":"
, tbold " import sources.nix { sourcesJson = PATH ; }; "
, T.unwords
[ " where", tbold "PATH", "is the relative path from sources.nix to"
, tbold (T.pack fp) <> "." ]
]
where
createFile :: FilePath -> B.ByteString -> NIO ()
createFile path content = liftIO $ do