@@ -41,11 +41,11 @@ import System.Directory
4141import System.FilePath
4242import qualified System.Info
4343import System.IO.Temp (withSystemTempDirectory)
44−import System.Which (staticWhich)
4544
4645import Obelisk.App (MonadObelisk, ObeliskT)
4746import Obelisk.CliApp (Severity (..) , callCommand, failWith, putLog, proc, readCreateProcessWithExitCode, readProcessAndLogStderr)
4847import Obelisk.Command.Project (inProjectShell, withProjectRoot)
48+import Obelisk.Command.Utils (findExePath, ghcidExePath, nixBuildExePath, nixExePath)
4949
5050data CabalPackageInfo = CabalPackageInfo
5151 { _cabalPackageInfo_packageFile :: FilePath
@@ -72,7 +72,7 @@ run = withProjectRoot "." $ \root -> do
7272 assets <- do
7373 let importableRoot = toNixPath root
7474 isDerivation <- readProcessAndLogStderr Debug $
75− proc nixPath
75+ proc nixExePath
7676 [ "eval"
7777 , "-f"
7878 , root
@@ -84,12 +84,12 @@ run = withProjectRoot "." $ \root -> do
8484 -- Check whether the impure static files are a derivation (and so must be built)
8585 if isDerivation == "1"
8686 then fmap T.strip $ readProcessAndLogStderr Debug $ -- Strip whitespace here because nix-build has no --raw option
87− proc nixBuildPath
87+ proc nixBuildExePath
8888 [ "--no-out-link"
8989 , "-E", "(import " <> importableRoot <> "{}).passthru.staticFilesImpure"
9090 ]
9191 else readProcessAndLogStderr Debug $
92− proc nixPath ["eval", "-f", root, "passthru.staticFilesImpure", "--raw"]
92+ proc nixExePath ["eval", "-f", root, "passthru.staticFilesImpure", "--raw"]
9393 putLog Debug $ "Assets impurely loaded from: " <> assets
9494 runGhcid dotGhciPath $ Just $ unwords
9595 [ "Obelisk.Run.run"
@@ -125,12 +125,8 @@ runWatch = do
125125getLocalPkgs :: (MonadObelisk m, MonadIO m) => FilePath -> m [FilePath]
126126getLocalPkgs root = do
127127 rootAbs <- liftIO $ makeAbsolute root
128− let findPath = $(staticWhich "find")
129− (_exitCode, out, err') <- readCreateProcessWithExitCode $
130− proc findPath ["-L", rootAbs, "(", "-name", "*.cabal", "-o", "-name", Hpack.packageConfig, ")", "-a", "-type", "f"]
131− case T.strip $ T.pack err' of
132− err | T.null err -> pure ()
133− | otherwise -> putLog Debug err
128+ proc findExePath ["-L", root, "(", "-name", "*.cabal", "-o", "-name", Hpack.packageConfig, ")", "-a", "-type", "f"]
129+ putLog Debug $ T.strip $ T.pack err
134130
135131 let packagePaths = filter (not . isIgnored) $ T.lines $ T.strip $ T.pack out
136132 obeliskImplDir = ".obelisk/impl/"