Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
argotk
Commits
0eed259a
Commit
0eed259a
authored
Mar 25, 2019
by
Valentin Reis
Browse files
slowly adding mtl stuff.
parent
7cea5526
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Argo/Stack.hs
View file @
0eed259a
...
...
@@ -47,7 +47,6 @@ import System.Process.Typed ( readProcessStdout_
,
proc
,
shell
,
setEnv
,
setEnvInherit
)
import
Text.Show.Pretty
...
...
src/Argo/Utils.hs
View file @
0eed259a
...
...
@@ -92,7 +92,7 @@ myWhich str =
""
->
die
$
"Argo `"
<>
str
<>
"` not in $PATH."
p
->
printInfo
(
"Found "
<>
str
<>
" at "
<>
p
)
$>
p
sudoRemoveFile
::
(
Text
->
IO
()
)
->
Text
->
Text
->
IO
()
sudoRemoveFile
::
(
Text
->
IO
()
)
->
Text
->
Text
->
IO
()
sudoRemoveFile
printer
desc
filePath
=
do
foundSocket
<-
doesFileExist
$
toS
filePath
when
foundSocket
$
go
False
...
...
@@ -149,27 +149,35 @@ withAsyncs :: IO a -> IO a1 -> (Async a -> Async a1 -> IO b) -> IO b
withAsyncs
io1
io2
f
=
withAsync
io1
$
\
a1
->
withAsync
io2
$
\
a2
->
f
a1
a2
doFilter
::
Maybe
TextBehavior
->
ConduitT
()
ByteString
IO
()
->
ConduitT
ByteString
Void
IO
()
->
IO
TracebackScan
::
(
MonadIO
m
)
=>
Maybe
TextBehavior
->
ConduitT
()
ByteString
m
()
->
ConduitT
ByteString
Void
m
()
->
m
TracebackScan
doFilter
behavior
source
sink
=
runConduit
$
source
.|
CB
.
lines
.|
makeBehavior
behavior
`
fuseUpstream
`
sink
makeBehavior
::
Maybe
TextBehavior
->
ConduitT
ByteString
ByteString
IO
TracebackScan
::
(
MonadIO
m
)
=>
Maybe
TextBehavior
->
ConduitT
ByteString
ByteString
m
TracebackScan
makeBehavior
=
\
case
Just
ExpectClean
->
warnOnTraceback
False
Just
(
WaitFor
message
)
->
untilMatch
message
False
Nothing
->
awaitForever
yield
$>
Clean
warnOnTraceback
::
Bool
->
ConduitT
ByteString
ByteString
IO
TracebackScan
warnOnTraceback
::
(
MonadIO
m
)
=>
Bool
->
ConduitT
ByteString
ByteString
m
TracebackScan
warnOnTraceback
sawTraceback
=
await
>>=
\
case
Just
b
|
B
.
isInfixOf
"Traceback"
b
->
yield
b
>>
warnOnTraceback
True
|
otherwise
->
yield
b
>>
warnOnTraceback
sawTraceback
Nothing
->
if
sawTraceback
then
return
WarningTraceback
else
return
Clean
untilMatch
::
Text
->
Bool
->
ConduitT
ByteString
ByteString
IO
TracebackScan
untilMatch
::
(
MonadIO
m
)
=>
Text
->
Bool
->
ConduitT
ByteString
ByteString
m
TracebackScan
untilMatch
msg
sawTraceback
=
await
>>=
\
case
Just
b
|
B
.
isInfixOf
"Traceback"
b
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment