Created
April 18, 2018 18:54
-
-
Save toddway/0e0ea95161e7d036d4454d374d5ebc2c to your computer and use it in GitHub Desktop.
bash command to fetch PR and launch in Android Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z "$1" ] | |
then | |
echo must provide a PR number | |
else | |
git fetch origin pull/$1/head:pr-$1 # for github | |
git fetch origin pull-requests/$1/from:pr-$1 # for bitbucket | |
git checkout pr-$1 | |
studio . | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SETUP | |
# if you haven't already cloned the repo develop branch locally: | |
git clone -b develop <repo-url> . | |
# initialize the Android Studio command line launcher: Tools > Create Command-line Launcher... > OK | |
# COMMAND | |
sh ~/pr-to-ide.sh <pr-id> # get the pr-id from the pull request url - usually just an incrementing number | |
# now use IDE to diff the develop branch, run tests, navigate files, see code inspection, etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment