Skip to content

Instantly share code, notes, and snippets.

@dmrschmidt
Created March 19, 2015 10:33
Show Gist options
  • Save dmrschmidt/769cc79b20eb5f8130f2 to your computer and use it in GitHub Desktop.
Save dmrschmidt/769cc79b20eb5f8130f2 to your computer and use it in GitHub Desktop.
dependency checking `git pull --rebase` alias
#!/bin/sh
git pull --rebase || exit 1;
root_path="$(git rev-parse --show-toplevel)"
bundle check > /dev/null; needs_bundle=$?
diff "${root_path}/Podfile.lock" "${root_path}/Pods/Manifest.lock" > /dev/null; needs_pod=$?
if [[ $needs_bundle != 0 ]] ; then
echo "\033[01;31m# Your bundler dependencies are outdated."
command="bundle install"
fi
if [[ $needs_pod != 0 ]] ; then
echo "\033[01;31m# Your CocoaPods dependencies are outdated."
if [[ $command != "" ]]; then command=" $command && "; fi
command="${command}pod install"
fi
echo "\033[00;00m${command}"
@garriguv
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment