Skip to content

Commit

Permalink
command: update to work with new fsnotify config
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-abrar committed Aug 1, 2023
1 parent 52fcb5d commit 579453b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/command/src/Obelisk/Command/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ import System.Directory
import System.Environment (lookupEnv)
import System.Exit (ExitCode(..))
import System.FilePath
import System.FSNotify (defaultConfig, eventPath, WatchConfig(..))
import qualified System.Info as SysInfo
import System.FSNotify (defaultConfig, eventPath, WatchConfig(..), WatchMode(..))
import qualified System.Info as Sys
import System.IO.Temp
import System.IO.Unsafe (unsafePerformIO)
import System.PosixCompat.Files
Expand Down Expand Up @@ -459,9 +459,11 @@ watchStaticFilesDerivation root = do
cfg = defaultConfig
-- On macOS, use the polling backend due to
-- https://github.com/luite/hfsevents/issues/13
{ confUsePolling = SysInfo.os == "darwin"
, confPollInterval = 250000
}
{ confWatchMode =
if Sys.os == "darwin"
then WatchModePoll 250000
else WatchModeOS
}
watch' pkg = fmap (:[]) <$> watchDirectoryTree cfg (root </> pkg <$ pb) (filterEvents . eventPath)
rebuild <- batchOccurrences 0.25 =<< mergeWith (<>) <$> mapM watch'
[ "frontend"
Expand Down

0 comments on commit 579453b

Please sign in to comment.