Last active
August 29, 2015 13:57
-
-
Save joesteele/9455884 to your computer and use it in GitHub Desktop.
Grep Android Version Name or Code
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
function grepversion() { | |
if [[ -n "$1" ]]; then | |
local LOOKUP=Name | |
local APP=$1 | |
if [[ -n "$1" && -n "$2" ]]; then | |
if [[ "$1" == "code" ]]; then | |
LOOKUP=Code | |
fi | |
APP=$2 | |
fi | |
grep version$LOOKUP $APP/src/main/AndroidManifest.xml| sed -e 's/.*\s*=\s*\"\([0-9.]*\)\".*/\1/g' | |
else | |
echo "proper usage: grepversion <name|code> <module name>. (e.g. 'grepversion code MyApp' or just 'grepversion MyApp')" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment