mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
274fefc84d
commit
4c33ffbe8c
|
@ -28,6 +28,8 @@ import Data.Maybe
|
||||||
import Data.Config.Suckless.Script
|
import Data.Config.Suckless.Script
|
||||||
|
|
||||||
import System.Exit hiding (die)
|
import System.Exit hiding (die)
|
||||||
|
import System.Console.ANSI
|
||||||
|
|
||||||
|
|
||||||
{- HLINT ignore "Use isEOF" -}
|
{- HLINT ignore "Use isEOF" -}
|
||||||
{- HLINT ignore "Use putStrLn" -}
|
{- HLINT ignore "Use putStrLn" -}
|
||||||
|
@ -79,6 +81,7 @@ localDict DeferredOps{..} = makeDict @C do
|
||||||
|
|
||||||
waitRepo Nothing =<< getGitRepoKeyThrow
|
waitRepo Nothing =<< getGitRepoKeyThrow
|
||||||
importGitRefLog
|
importGitRefLog
|
||||||
|
notice "done importGitRefLog"
|
||||||
|
|
||||||
rrefs <- importedRefs
|
rrefs <- importedRefs
|
||||||
|
|
||||||
|
@ -137,32 +140,31 @@ main = flip runContT pure do
|
||||||
|
|
||||||
setupLogger
|
setupLogger
|
||||||
|
|
||||||
-- origStderr <- liftIO $ dup stdError
|
origStderr <- liftIO $ dup stdError
|
||||||
-- (readEnd, writeEnd) <- liftIO createPipe
|
(readEnd, writeEnd) <- liftIO createPipe
|
||||||
-- liftIO $ dupTo writeEnd stdError
|
liftIO $ dupTo writeEnd stdError
|
||||||
-- liftIO $ closeFd writeEnd
|
liftIO $ closeFd writeEnd
|
||||||
|
|
||||||
-- rStderr <- liftIO $ fdToHandle readEnd
|
rStderr <- liftIO $ fdToHandle readEnd
|
||||||
-- origHandle <- liftIO $ fdToHandle origStderr
|
origHandle <- liftIO $ fdToHandle origStderr
|
||||||
|
|
||||||
-- liftIO $ hSetBuffering origHandle NoBuffering
|
liftIO $ hSetBuffering origHandle NoBuffering
|
||||||
|
|
||||||
-- liftIO $ IO.hPutStr origHandle "\n"
|
liftIO $ IO.hPutStr origHandle "\n"
|
||||||
-- ContT $ withAsync $ liftIO $ forever do
|
ContT $ withAsync $ liftIO $ forever do
|
||||||
-- pause @'Seconds 0.25
|
pause @'Seconds 0.25
|
||||||
-- wut <- IO.hGetContents rStderr <&> lines
|
wut <- IO.hGetContents rStderr <&> lines
|
||||||
-- for_ wut $ \s -> do
|
for_ wut $ \s -> do
|
||||||
-- IO.hPutStrLn rStderr s
|
|
||||||
-- IO.hPutStr origHandle (replicate 100 ' ')
|
hClearLine origHandle
|
||||||
-- IO.hPutStr origHandle "\r"
|
hSetCursorColumn origHandle 0
|
||||||
-- IO.hPutStr origHandle s
|
IO.hPutStr origHandle s
|
||||||
-- IO.hPutStr origHandle "\r"
|
hSetCursorColumn origHandle 0
|
||||||
-- pause @'Seconds 0.05
|
-- pause @'Seconds 0.05
|
||||||
|
|
||||||
-- ContT $ bracket none $ const do
|
ContT $ bracket none $ const do
|
||||||
-- IO.hPutStr origHandle (replicate 100 ' ')
|
hClearLine origHandle
|
||||||
-- IO.hPutStr origHandle "\r"
|
hSetCursorColumn origHandle 0
|
||||||
-- silence
|
|
||||||
|
|
||||||
lift $ void $ installHandler sigPIPE Ignore Nothing
|
lift $ void $ installHandler sigPIPE Ignore Nothing
|
||||||
env <- nullGit3Env
|
env <- nullGit3Env
|
||||||
|
|
|
@ -149,6 +149,7 @@ library
|
||||||
, base16-bytestring
|
, base16-bytestring
|
||||||
, binary
|
, binary
|
||||||
, psqueues
|
, psqueues
|
||||||
|
, ansi-terminal
|
||||||
, unix
|
, unix
|
||||||
|
|
||||||
hs-source-dirs: lib
|
hs-source-dirs: lib
|
||||||
|
@ -164,6 +165,7 @@ executable hbs2-git3
|
||||||
, binary
|
, binary
|
||||||
, psqueues
|
, psqueues
|
||||||
, vector
|
, vector
|
||||||
|
, ansi-terminal
|
||||||
, zstd
|
, zstd
|
||||||
|
|
||||||
hs-source-dirs: app
|
hs-source-dirs: app
|
||||||
|
@ -178,6 +180,7 @@ executable git-remote-hbs23
|
||||||
base, hbs2-git3, hbs2-core, hbs2-peer, hbs2-git
|
base, hbs2-git3, hbs2-core, hbs2-peer, hbs2-git
|
||||||
, binary
|
, binary
|
||||||
, vector
|
, vector
|
||||||
|
, ansi-terminal
|
||||||
|
|
||||||
hs-source-dirs: app
|
hs-source-dirs: app
|
||||||
default-language: GHC2021
|
default-language: GHC2021
|
||||||
|
|
Loading…
Reference in New Issue