Skip to content

Instantly share code, notes, and snippets.

@viktorbenei
Created October 15, 2014 10:22
Show Gist options
  • Save viktorbenei/2031e94eda244f038d85 to your computer and use it in GitHub Desktop.
Save viktorbenei/2031e94eda244f038d85 to your computer and use it in GitHub Desktop.
Upgrade CocoaPods on Bitrise
#!/bin/bash
#
# Prints the given command, then executes it
# Example: print_and_do_command echo 'hi'
#
function print_and_do_command {
echo " -> $ $@"
$@
}
#
# Print the given command, execute it
# and exit if error happened
function print_and_do_command_exit_on_error {
print_and_do_command $@
if [ $? -ne 0 ]; then
echo " [!] Failed!"
exit 1
fi
}
echo "-- Updating CocoaPods --"
print_and_do_command_exit_on_error gem install cocoapods
print_and_do_command_exit_on_error pod setup
echo "-- DONE --"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment