Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Reis
argotest
Commits
affb0e5c
Commit
affb0e5c
authored
Dec 13, 2018
by
Valentin Reis
Browse files
Correcting file output.
parent
9d854fec
Pipeline
#4655
passed with stage
in 27 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
argotest/src/Argotest.hs
View file @
affb0e5c
...
@@ -19,7 +19,8 @@ import System.Console.ANSI
...
@@ -19,7 +19,8 @@ import System.Console.ANSI
import
System.Console.ANSI.Types
(
Color
)
import
System.Console.ANSI.Types
(
Color
)
import
System.Posix.Signals
import
System.Posix.Signals
import
System.Process
hiding
(
shell
)
import
System.Process
hiding
(
shell
)
import
Data.Text
hiding
(
empty
)
import
Data.Text
as
Text
hiding
(
empty
)
import
Data.Text.IO
as
Text
data
StackArgs
=
StackArgs
data
StackArgs
=
StackArgs
{
dargs
::
[
Text
]
--"Daemon arguments. Properly quote this."
{
dargs
::
[
Text
]
--"Daemon arguments. Properly quote this."
...
@@ -112,7 +113,21 @@ prepareDaemonShell dargs daemon_out daemon_err nrm_log = do
...
@@ -112,7 +113,21 @@ prepareDaemonShell dargs daemon_out daemon_err nrm_log = do
False
->
die
(
"Clean config failed with exit code "
<>
repr
n
)
False
->
die
(
"Clean config failed with exit code "
<>
repr
n
)
printInfo
$
format
(
"Running the daemon, main log at "
%
fp
%
", stdout at "
%
fp
%
", stderr at "
%
fp
%
"
\n
"
)
nrm_log
daemon_out
daemon_err
printInfo
$
format
(
"Running the daemon, main log at "
%
fp
%
", stdout at "
%
fp
%
", stderr at "
%
fp
%
"
\n
"
)
nrm_log
daemon_out
daemon_err
export
"ARGO_NODEOS_CONFIG"
(
format
fp
confPath'
)
export
"ARGO_NODEOS_CONFIG"
(
format
fp
confPath'
)
return
$
sh
$
view
$
inprocWithErr
"daemon"
(
dargs
++
[
"--nrm_log"
,
Data
.
Text
.
pack
$
(
encodeString
nrm_log
)])
empty
return
$
twoWayPrint
daemon_out
daemon_err
$
inprocWithErr
"daemon"
(
dargs
++
[
"--nrm_log"
,
Text
.
pack
$
encodeString
nrm_log
])
empty
--twoWayPrint l
--case l of
-- Left out -> output daemon_out $ return out
-- Right err -> output daemon_err $ return err
twoWayPrint
::
FilePath
->
FilePath
->
Shell
(
Either
Line
Line
)
->
IO
()
twoWayPrint
outPath
errPath
s
=
sh
$
do
handleOut
<-
using
(
writeonly
outPath
)
handleErr
<-
using
(
writeonly
errPath
)
s
>>=
\
case
Left
out
->
liftIO
$
Text
.
hPutStrLn
handleOut
(
lineToText
out
)
Right
err
->
liftIO
$
Text
.
hPutStrLn
handleOut
(
lineToText
err
)
cmdShell
::
FilePath
->
Text
->
FilePath
->
FilePath
->
Shell
()
cmdShell
::
FilePath
->
Text
->
FilePath
->
FilePath
->
Shell
()
cmdShell
manifest
app
cmd_out
cmd_err
=
cmdShell
manifest
app
cmd_out
cmd_err
=
...
...
default.nix
View file @
affb0e5c
...
@@ -27,6 +27,10 @@ in rec
...
@@ -27,6 +27,10 @@ in rec
};
};
dev-test
=
pkgs
.
stdenv
.
mkDerivation
rec
{
dev-test
=
pkgs
.
stdenv
.
mkDerivation
rec
{
shellHook
=
''
source completions/bash/argotk.sh
echo "Installed bash completions."
''
;
name
=
"env"
;
name
=
"env"
;
env
=
pkgs
.
buildEnv
{
name
=
name
;
paths
=
buildInputs
;
};
env
=
pkgs
.
buildEnv
{
name
=
name
;
paths
=
buildInputs
;
};
buildInputs
=
[
buildInputs
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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