From cd01584411d583203603b3b058785513c2448910 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 22 Aug 2024 08:27:04 +0700 Subject: [PATCH] Print extra interpreter arguments --- .github/workflows/build.yml | 7 ++----- cabal.project | 5 +++++ src/Run.hs | 10 ++++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5566d0f..d006000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: - '9.8' - '9.10' include: - - os: macos-latest + - os: macos-12 ghc: system steps: - uses: actions/checkout@v3 @@ -55,9 +55,6 @@ jobs: - shell: bash run: cabal update - - shell: bash - run: cabal configure --enable-tests --enable-benchmarks - - shell: bash run: cabal build all @@ -65,7 +62,7 @@ jobs: run: echo | cabal repl sensei --build-depends hspec-meta - shell: bash - run: cabal exec -- "${PWD}/$(find dist-newstyle/ -name spec -type f)" --times --print-slow + run: cabal exec -- $(cabal list-bin spec) --times --print-slow env: HSPEC_OPTIONS: --color diff --git a/cabal.project b/cabal.project index 10d1274..282723f 100644 --- a/cabal.project +++ b/cabal.project @@ -5,3 +5,8 @@ package sensei ghc-options: -Werror tests: True + +source-repository-package + type: git + location: https://github.com/sol/hinotify/ + tag: 2131698f86939542c7df2cf3e60b40cc7e42819c diff --git a/src/Run.hs b/src/Run.hs index c87d74e..e0b4d7f 100644 --- a/src/Run.hs +++ b/src/Run.hs @@ -138,11 +138,17 @@ runWith RunArgs {..} = do , afterReload = config.senseiHooksAfterReload } + go :: [String] -> IO () go extraArgs = do status <- withSession sessionConfig (extraArgs <> args) $ \ session -> do let - triggerAction = saveOutput (trigger session hooks) - triggerAllAction = saveOutput (triggerAll session hooks) + printExtraArgs :: IO () + printExtraArgs = forM_ extraArgs $ \ arg -> do + sessionConfig.configEcho . encodeUtf8 . withColor Red $ arg <> "\n" + + triggerAction = saveOutput (trigger session hooks <* printExtraArgs) + triggerAllAction = saveOutput (triggerAll session hooks <* printExtraArgs) + triggerAction processQueue runCleanupAction (sessionConfig.configEcho . encodeUtf8) dir queue triggerAllAction triggerAction case status of