on master help sign in
Fix checking that impl dir exists
commitea8390eeda97a63c6bbb36303851225a3d67daf4 authorTom Smalley <tfsmalley@gmail.com> dateTue 15 May 2018, 13:35 (8 years ago) parent17d2461
1 file changed+5−5
lib/command/src/Obelisk/Command/Project.hs+5−5
lib/command/src/Obelisk/Command/Project.hs+5−5
@@ -58,13 +58,13 @@ toObeliskDir :: FilePath -> FilePath
5858toObeliskDir p = p </> ".obelisk"
5959
6060-- | Path to impl file in given path
61−implFile :: FilePath -> FilePath
62−implFile p = toObeliskDir p </> "impl"
61+toImplDir :: FilePath -> FilePath
62+toImplDir p = toObeliskDir p </> "impl"
6363
6464-- | Create a new project rooted in the current directory
6565initProject :: MonadObelisk m => InitSource -> m ()
6666initProject source = do
67− let implDir = implFile "."
67+ let implDir = toImplDir "."
6868 liftIO $ createDirectory $ toObeliskDir "."
6969 case source of
7070 InitSource_Default -> liftIO $ createThunkWithLatest implDir obeliskSource
@@ -99,7 +99,7 @@ findProjectObeliskCommand target = do
9999 targetStat <- liftIO $ getFileStatus target
100100 (result, insecurePaths) <- flip runStateT [] $ walkToProjectRoot target targetStat myUid >>= \case
101101 Nothing -> pure Nothing
102− Just projectRoot -> liftIO (doesFileExist $ implFile projectRoot) >>= \case
102+ Just projectRoot -> liftIO (doesDirectoryExist $ toImplDir projectRoot) >>= \case
103103 False -> do
104104 putLog Warning $ "Found obelisk directory in " <> T.pack projectRoot <> " but the implementation (impl) file is missing"
105105 pure Nothing
@@ -108,7 +108,7 @@ findProjectObeliskCommand target = do
108108 return $ Just projectRoot
109109 case (result, insecurePaths) of
110110 (Just projDir, []) -> do
111− obeliskCommandPkg <- nixBuildAttrWithCache (implFile projDir) "command"
111+ obeliskCommandPkg <- nixBuildAttrWithCache (toImplDir projDir) "command"
112112 return $ Just $ obeliskCommandPkg </> "bin" </> "ob"
113113 (Nothing, _) -> return Nothing
114114 (Just projDir, _) -> do