asciinema / asciicast2gif

Generate GIF animations from asciicasts (asciinema recordings)
MIT License
1.2k stars 83 forks source link

Exist status = 0 even if there is an error #68

Closed rockandska closed 2 years ago

rockandska commented 5 years ago

Hi,

Not sure if it is related to asciicast2gif or directly to to the player but the exit status is 0 even if there is an error:

docker run --rm -v /tmp:/data asciinema/asciicast2gif -w 80 -h 12 -S 1 tmp_slash error.gif; echo $?
==> Loading tmp_slash...
only asciicast v1 and v2 formats can be opened
==> Done.
0
mathieu-aubin commented 5 years ago

you are getting back the exit status of docker i believe

since you are closing your docker command line with the ' ; ' character, the $? status you are getting back from your shell is the one of docker, which more than likely is correct (as the container ran without problems)

Try quoting your commands 'asciicast2gif.... ; echo $?' and see if you get a different result.

rockandska commented 5 years ago

It is not related to the way i run the command:

$ docker run -ti --rm -v /tmp:/data --entrypoint /bin/bash asciinema/asciicast2gif
root@d73071ae0487:/data# touch tmp_slash
root@d73071ae0487:/data# /app/asciicast2gif -w 80 -h 12 -S 1 tmp_slash error.gif
==> Loading tmp_slash...
only asciicast v1 and v2 formats can be opened
==> Done.
root@d73071ae0487:/data# echo $?
0
mathieu-aubin commented 5 years ago

Proof is here at least, being precise saves time! thanks for updating.

mathieu-aubin commented 5 years ago

I can confirm that this doesn't trigger any error codes upon failure with the here mentionned way of reproducing (empty file -> wrong filetype -> status still 'good')

The error seem to come from the 'player' and is not passed on as an error

ku1ik commented 2 years ago

Closing as asciicast2gif is dead. Try https://github.com/asciinema/agg instead.