Skip to content

Instantly share code, notes, and snippets.

@dmrschmidt
Created March 19, 2015 10:33
Show Gist options
  • Select an option

  • Save dmrschmidt/769cc79b20eb5f8130f2 to your computer and use it in GitHub Desktop.

Select an option

Save dmrschmidt/769cc79b20eb5f8130f2 to your computer and use it in GitHub Desktop.

Revisions

  1. dmrschmidt created this gist Mar 19, 2015.
    21 changes: 21 additions & 0 deletions gpr.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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}"