on master help sign in
Pass absolute path as nix root
commite0c486088c90a9c59a68e2d7c40fb5d7b55a4baa authorleon.smith@obsidian.systems <leon.smith@obsidian.systems> dateWed 29 Jan 2020, 14:54 (7 years ago) parent32019d1
1 file changed+5−3
lib/command/src/Obelisk/Command/Run.hs+5−3
lib/command/src/Obelisk/Command/Run.hs+5−3
@@ -289,9 +289,10 @@ runGhciRepl
289289 => [CabalPackageInfo]
290290 -> FilePath -- ^ Path to .ghci
291291 -> m ()
292−runGhciRepl packages dotGhci = withProjectRoot "." $ \root ->
292+runGhciRepl packages dotGhci = withProjectRoot "." $ \root -> do
293293 -- NOTE: We do *not* want to use $(staticWhich "ghci") here because we need the
294294 -- ghc that is provided by the shell in the user's project.
295+ rootAbs <- liftIO $ makeAbsolute root
295296 nixShellWithPkgs root True (packageInfoToNamePathMap packages) $ Just $ "ghci " <> makeBaseGhciOptions dotGhci -- TODO: Shell escape
296297
297298-- | Run ghcid
@@ -301,8 +302,9 @@ runGhcid
301302 -> [CabalPackageInfo]
302303 -> Maybe String -- ^ Optional command to run at every reload
303304 -> m ()
304−runGhcid dotGhci packages mcmd = withProjectRoot "." $ \root ->
305− nixShellWithPkgs root True (packageInfoToNamePathMap packages) (Just $ unwords $ ghcidExePath : opts) -- TODO: Shell escape
305+runGhcid dotGhci packages mcmd = withProjectRoot "." $ \root -> do
306+ rootAbs <- liftIO $ makeAbsolute root
307+ nixShellWithPkgs rootAbs True (packageInfoToNamePathMap packages) (Just $ unwords $ ghcidExePath : opts) -- TODO: Shell escape
306308 where
307309 opts =
308310 [ "-W"