ricklamers/shell-ai

Error : returned non-zero exit status 1

Closed this issue · 1 comments

When I try a simple ls command, I got this error message:

(base) ➜  ~ shai list images ls
? Select a command: ls *.jpg *.png *.jpeg *.gif *.bmp
ls: *.bmp: No such file or directory
ls: *.gif: No such file or directory
ls: *.jpeg: No such file or directory
ls: *.png: No such file or directory
710097.jpg
Error executing command: Command 'ls *.jpg *.png *.jpeg *.gif *.bmp' returned non-zero exit status 1.

It seems that if part of the command fail, I end uo with this error message instead of the usual empty string. Any idea why ?

It's an implementation choice of acting on the return exit code of command:

except subprocess.CalledProcessError as e:

I thought it was pretty unix-y but agree in this example it's a bit annoying perhaps. I'll probably leave it like this though.