on master help sign in
Merge pull request #656 from obsidiansystems/eac@hide-attrcache-packages

Exclude .attr-cache symlinks from local packages

commit87186ca619495032ceb1f38b9ff1a548c2de9c4e authorElliot Cameron <3noch@users.noreply.github.com> dateWed 12 Feb 2020, 18:14 (7 years ago) parentd821424494e2fa
1 file changed+3−2
lib/command/src/Obelisk/Command/Run.hs+3−2
lib/command/src/Obelisk/Command/Run.hs+3−2
@@ -48,7 +48,8 @@ import System.IO.Temp (withSystemTempDirectory)
4848
4949import Obelisk.App (MonadObelisk)
5050import Obelisk.CliApp (Severity (..) , failWith, putLog, proc, readCreateProcessWithExitCode, readProcessAndLogStderr, setCwd)
51−import Obelisk.Command.Project (withProjectRoot, nixShellWithPkgs)
51+import Obelisk.Command.Project (nixShellWithPkgs, toImplDir, withProjectRoot)
52+import Obelisk.Command.Thunk (attrCacheFileName)
5253import Obelisk.Command.Utils (findExePath, ghcidExePath, nixBuildExePath, nixExePath)
5354
5455data CabalPackageInfo = CabalPackageInfo
@@ -128,7 +129,7 @@ getLocalPkgs root = do
128129 let exclusions = filter (/= root) $ map takeDirectory obeliskPaths
129130 fmap (map (makeRelative ".")) $ runFind $
130131 ["-L", root, "(", "-name", "*.cabal", "-o", "-name", Hpack.packageConfig, ")", "-a", "-type", "f"]
131− <> concat [["-not", "-path", p </> "*"] | p <- exclusions]
132+ <> concat [["-not", "-path", p </> "*"] | p <- (toImplDir "*" </> attrCacheFileName) : exclusions]
132133 where
133134 runFind args = do
134135 (_exitCode, out, err) <- readCreateProcessWithExitCode $ proc findExePath args