nowsecure / node-applesign

NodeJS module and commandline utility for re-signing iOS applications (IPA files).
https://www.nowsecure.com
MIT License
420 stars 77 forks source link

exits with 0 exit code even when failed #87

Closed dweinstein closed 4 years ago

dweinstein commented 4 years ago

Expected applesign to exit with non-zero exit since it failed to run zip and the exitCode from zip was non-zero.

...
Zipifying into /Users/user/test/bins/foo.ipa ...
stdout: zip I/O error: No such file or directory
zip error: Could not create output file (/Users/user/test/bins/foo.ipa)

stderr:
command: /usr/bin/zip -qry /Users/user/test/bins/foo.ipa .
code: 15
Cleaning up ........ snip ......
Target is now signed: ./test/bins/foo-resigned.ipa
Cleaning up ........ snip .......
...
± echo $?
0

it would appear this is intentional behavior in this code https://github.com/nowsecure/node-applesign/blob/b1000aa864f4de9895d0e046db1b7accfa37c4ff/lib/tools.js#L46-L47

but why do we only console.error log this rather than actually bubble up a proper Error?