con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

Do not obscure/change original stdout/stderr anyhow #26

Closed yarikoptic closed 1 month ago

yarikoptic commented 1 month ago

Might be related to

Should output as is it was received, no changes! So if there are any ANSI terminal control characters (see https://en.wikipedia.org/wiki/ANSI_escape_code and #24) -- they should be passed as is. I think the fact that output is somehow changed we get output from git annex addurl which likely uses some \r or may be some other ANSI command gets to look like

$> duct scripts/replace_neurodesk_urls
OK: https://d15yxasja65rk8.cloudfront.net/afni_21.2.00_20210714.simg
 INFO: adding https://d15yxasja65rk8.cloudfront.net/afni_21.2.00_20210714.simg to images/neurodesk/neurodesk-afni--21.2.00.simg
^[[0Jaddurl https://d15yxasja65rk8.cloudfront.net/afni_21.2.00_20210714.simg ok
^[[1G(recording state in git...)
 INFO: removing 108 oracle urls
rmurl images/neurodesk/neurodesk-afni--21.2.00.simg ok
rmurl images/neurodesk/neurodesk-afni--21.2.00.simg ok
rmurl images/neurodesk/neurodesk-afni--21.2.00.simg ok
{"Command": "scripts/replace_neurodesk_urls", "System": {"uid": "yoh", "memory_total": 135060111360, "cpu_total": 16}, "ENV": [{}], "GPU": []}

Similarly to #25 the test could be to run duct running a command which outputs all kinds of "stuff" and ensuring that output we get to stdout from running duct is exactly what that command produces!