on master help sign in
Disable spinner on noSpinner

This is supposed to disable the spinner in shell completion runs. though I have not been able to test it yet.

commit342ccab545ddfaa98f6945000d34f73eceaba6df authorSridhar Ratnakumar <srid@srid.ca> dateSat 12 May 2018, 22:35 (8 years ago) parentade2c21
2 files changed+7−5
lib/command/src/Obelisk/App.hs+1−1 lib/command/src/Obelisk/Command/Utils.hs+6−4
lib/command/src/Obelisk/App.hs+1−1
@@ -12,7 +12,7 @@ import Control.Monad.Reader (MonadIO, MonadReader, ReaderT, runReaderT)
1212import Obelisk.CLI.Logging (LoggingConfig, Output, handleLog)
1313
1414data Obelisk = Obelisk
15− { _obelisk_noSpinner :: Bool
15+ { _obelisk_noSpinner :: Bool -- Used to disable the spinner.
1616 , _obelisk_logging :: LoggingConfig
1717 }
1818
lib/command/src/Obelisk/Command/Utils.hs+6−4
@@ -2,14 +2,14 @@
22{-# LANGUAGE OverloadedStrings #-}
33module Obelisk.Command.Utils where
44
5−import Control.Monad.Reader (asks)
5+import Control.Monad.Reader (ask)
66import qualified Data.List as L
77import Data.Semigroup ((<>))
88import Data.Text (Text)
99import qualified Data.Text as T
1010import System.Process
1111
12−import Obelisk.App (MonadObelisk, _obelisk_logging)
12+import Obelisk.App (MonadObelisk, _obelisk_logging, _obelisk_noSpinner)
1313import Obelisk.CLI.Spinner (withSpinner')
1414
1515-- Check whether the working directory is clean
@@ -39,5 +39,7 @@ cp = callProcessNixShell ["coreutils"] "cp"
3939
4040withSpinner :: MonadObelisk m => Text -> m a -> m a
4141withSpinner s a = do
42− c <- asks _obelisk_logging
43− withSpinner' c s a
42+ conf <- ask
43+ case _obelisk_noSpinner conf of
44+ True -> a
45+ False -> withSpinner' (_obelisk_logging conf) s a