I have some runs that if they fail produce a ton of output. I have been struggling with the dagger cli to redirect or capture output. I have tried plaintext and using script. That works okay but is there idiomatic way to capture the output of a run? This is running commands in a standard unix terminal. I did run some google searches and searched on discord but didn't find what I was looking for.
#Capturing cli output
1 messages · Page 1 of 1 (latest)
hey! yes there is! are you using modules? or the SDK directly?
So I think I may have found it. For SDK it would be similar to:
# Use the saved exit code to determine if the tests passed.
exit_code = await ctr.file("exit_code").contents()
if exit_code != "0":
print("Tests failed!", file=sys.stderr)
else:
print("Tests passed!")
for modules it would be something like this: https://github.com/dagger/dagger/issues/5820#issuecomment-1775382506