on master help sign in
Fix project shells
commit8089f871cccc886f079e5b99641a18793dc4f07b authorAlexandre Esteves <alexandre.fmp.esteves@gmail.com> dateSat 6 Mar 2021, 20:01 (6 years ago) parent53957d7
2 files changed+7−4
lib/command/src/Obelisk/Command/Project.hs+4 lib/command/src/Obelisk/Command/Run.hs+3−4
lib/command/src/Obelisk/Command/Project.hs+4
@@ -12,6 +12,7 @@ module Obelisk.Command.Project
1212 , initProject
1313 , nixShellRunConfig
1414 , nixShellRunProc
15+ , obShellRunProc
1516 , nixShellWithHoogle
1617 , nixShellWithoutPkgs
1718 , obeliskDirName
@@ -317,6 +318,9 @@ bashEscape = BSU.toString . bytes . bash . BSU.fromString
317318nixShellRunProc :: NixShellConfig -> ProcessSpec
318319nixShellRunProc cfg = setDelegateCtlc True $ proc nixShellPath $ runNixShellConfig cfg
319320
321+obShellRunProc :: FilePath -> Text -> ProcessSpec
322+obShellRunProc root cmd = setDelegateCtlc True $ setCwd (Just root) $ proc "ob" ["shell", T.unpack cmd]
323+
320324nixShellWithoutPkgs
321325 :: MonadObelisk m
322326 => FilePath -- ^ Path to project root
lib/command/src/Obelisk/Command/Run.hs+3−4
@@ -523,13 +523,12 @@ loadPackageIndex root = do
523523 liftIO $ getInstalledPackages Verbosity.silent compiler [GlobalPackageDB] programDb
524524 where
525525 getPathInNixEnvironment cmd = do
526− procSpec <- runProc <$> nixShellRunConfig root True (Just cmd)
527− (_,Just h,_,_) <- createProcess_ "loadPackageIndex" procSpec
526+ (_,Just h,_,_) <- createProcess_ "loadPackageIndex" $ procSpec cmd
528527 path <- liftIO $ hGetLine h >>= canonicalizePath
529528 liftIO $ hClose h
530529 pure path
531− runProc =
532− overCreateProcess (\cs -> cs { std_out = CreatePipe }) . nixShellRunProc
530+ procSpec =
531+ overCreateProcess (\cs -> cs { std_out = CreatePipe }) . obShellRunProc root
533532
534533baseGhciOptions :: [String]
535534baseGhciOptions =