I have a custom script in Xcode which returns an error, but suppose I don't care. Xcode doesn't care about /dev/null and won't compile
sdef "$INPUT_FILE_PATH" | sdp -fh -o "$DERIVED_FILES_DIR"
--basename "$INPUT_FILE_BASE"
--bundleid `defaults read "$INPUT_FILE_PATH/Contents/Info" CFBundleIdentifier`
It's basically for generating a .h file based on Apple Script Definitions, and it went all fine up until a recent OS X update.
In the terminal, all I have to so is end this command with
2>/dev/null
and no error is returned. Whatever I try with 2> or just > or even &> doesn't work in Xcode, it will always return me an error.
/bin/sh -c "sdef \"$INPUT_FILE_PATH\" | sdp -fh -o \"$DERIVED_FILES_DIR\"
--basename \"$INPUT_FILE_BASE\" --bundleid `defaults read
\"$INPUT_FILE_PATH/Contents/Info\" CFBundleIdentifier` 2> /dev/null"
Command /bin/sh failed with exit code 1
Appending 2>/dev/null does not prevent the error status being returned by the sdef command, it just hides the error message.
Replace it with
|| echo "Failed".
If the sdef fails, the second part of the command is exited, and the echo should not report a bad status.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With