fix tapas to work in more shells

tapas with multiple app names currently works in bash but discards all
but the first app in others (specifically, zsh).  Use shell
constructions that are more universal.

Change-Id: I2f836ddf75b89019ac04ef99647d782ffe79cfee
This commit is contained in:
Doug Zongker 2014-04-16 11:34:34 -07:00
parent 45518095f5
commit 0d8179e84b

View file

@ -552,12 +552,12 @@ function _lunch()
complete -F _lunch lunch
# Configures the build to build unbundled apps.
# Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME)
# Run tapas with one or more app names (from LOCAL_PACKAGE_NAME)
function tapas()
{
local arch=$(echo -n $(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|mips|armv5)$'))
local variant=$(echo -n $(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$'))
local apps=$(echo -n $(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|mips|armv5)$'))
local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|mips|armv5)$' | xargs)"
local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|mips|armv5)$' | xargs)"
if [ $(echo $arch | wc -w) -gt 1 ]; then
echo "tapas: Error: Multiple build archs supplied: $arch"