0

I don't see sips to emit error codes at all:

$ sips main.rb -g all
/Users/nakilon/main.rb
Error: Error querying file

$ echo $?
0

$ sips main.rb -g allasdasda
/Users/nakilon/main.rb
Error: Error querying file

$ echo $?
0

How do I know if it has failed?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
  • what do you get from `file $(which sips)` ? Good luck. – shellter Jan 08 '17 at 13:53
  • @shellter, `/usr/bin/sips: Mach-O 64-bit executable x86_64` – Nakilon Jan 08 '17 at 14:41
  • @Nakilon I think that this is not actually a programming problem -- or rather, it is, but you've already solved the programming part of it by testing `$?`. The fact that `sips` returns 0 on failure means that it isn't playing nice, and you need to file a bug with the author of the program. – Barton Chittenden Jan 08 '17 at 15:49
  • @BartonChittenden, yeah, at first I was about to ask it at AskDifferent but thought this problem was more technical. I'll repost it there if noone would share their experience here. For now I check the STDERR for emptiness. – Nakilon Jan 08 '17 at 18:56

1 Answers1

0

sips (as you have tagged it) is a macOS program for processing images at the command-line which is probably not going to want to do much with a Ruby program text/script.

If you really do mean to use sips and with a Ruby file, you need to put the flags before the filename:

sips -g someImage
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432