Skip to content

Conversation

webmaster128
Copy link
Contributor

This fixes two minor issues in the script as described in the commit messages.

@segiddins
Copy link
Member

👍 with a CHANGELOG, we'll also have to rebuild the integration specs

@webmaster128
Copy link
Contributor Author

Thanks for feedback. I am a novice in all this CocoaPods Ruby magic. Is there anything else apart from the CHANGELOG entry, I can do?

EOM
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this was changed to echo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad you ask:

  • It is one line instead of three
  • echo is a built-in in most shells and usually faster because it avoids a process (confirm which cat and which echo in the shell of your choice)
  • cat is a tool made for concatenating files. Whenever cat is used with only one file, it is likely to be abused
  • Combining the reading from STDIN (the << EOM part) with the redirect to stderr (>&2) would be hard to unserstand syntactically

So the more interesting question would be, why ever someone started using cat for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ thanks 👯

Simon Warta added 3 commits July 6, 2016 10:33
The script is integrated using /bin/sh but [[ is not defined in generic
POSIX shell. Confirm shellcheck error:

if [[ $? != 0 ]] ; then
   ^-- SC2039: In POSIX sh, [[ ]] is undefined.

This works right now, because on common OS X systems, /bin/sh is Bash.
But this might change in the future.
This ensures that scripts like xcpretty can differentiate default output
and error output.
@webmaster128
Copy link
Contributor Author

Check

@segiddins
Copy link
Member

👍🏻

@segiddins segiddins merged commit 791a51f into CocoaPods:master Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants