Skip to content

Instantly share code, notes, and snippets.

@hjanuschka
Created November 25, 2016 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hjanuschka/3040fc6f371f46acff72a5e67f649b27 to your computer and use it in GitHub Desktop.
Save hjanuschka/3040fc6f371f46acff72a5e67f649b27 to your computer and use it in GitHub Desktop.
#!/bin/bash
FORK=$1
BRANCH=$2
CMD=$3
shift 3
REST=$*
PR_FOLDER="/tmp/pr-try-${FORK}-${BRANCH}"
# check for bundler
type -a bundler 2>&1
if [ $? != 0 ]
then
echo "you need to have bundler installed"
exit 2
fi
if [ -d $PR_FOLDER ]
then
echo "Wipe previous try"
rm -fr $PR_FOLDER
fi
# 1. Clone PR
git clone -b $BRANCH https://github.com/$FORK/fastlane "${PR_FOLDER}"
echo "Cloning PR: $PR"
echo "Running: $CMD $REST"
export BUNDLE_GEMFILE="${PR_FOLDER}/Gemfile"
# use all gems from source folder
export FASTLANE_LOCAL_DEV=1
echo "launching fork"
bundle update
bundle exec $CMD $REST
@hjanuschka
Copy link
Author

hjanuschka commented Nov 25, 2016

run it with:

  • ./try_pr.sh hjanuschka deliver_pkg fastlane env
  • ./try_pr.sh hjanuschka deliver_pkg deliver

and so on

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