Skip to content

hide "set -x" into an option #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions distribute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ CBLUE="\x1b[34;01m"
CGRAY="\x1b[30;01m"
CRESET="\x1b[39;49;00m"
DO_CLEAN_BUILD=0
DO_SET_X=0

# Use ccache ?
which ccache &>/dev/null
Expand All @@ -71,8 +72,6 @@ if [ $? -eq 0 ]; then
export NDK_CCACHE="ccache"
fi

set -x

function try () {
"$@" || exit -1
}
Expand Down Expand Up @@ -210,6 +209,7 @@ function usage() {
echo " -l Show a list of available modules"
echo " -m 'mod1 mod2' Modules to include"
echo " -f Restart from scratch (remove the current build)"
echo " -x display expanded values (execute 'set -x')"
echo
exit 0
}
Expand Down Expand Up @@ -615,7 +615,7 @@ function arm_deduplicate() {


# Do the build
while getopts ":hvlfm:d:s" opt; do
while getopts ":hvlfxm:d:s" opt; do
case $opt in
h)
usage
Expand All @@ -638,6 +638,9 @@ while getopts ":hvlfm:d:s" opt; do
f)
DO_CLEAN_BUILD=1
;;
x)
DO_SET_X=1
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
Expand All @@ -653,4 +656,9 @@ while getopts ":hvlfm:d:s" opt; do
esac
done

if [ $DO_SET_X -eq 1 ]; then
info "Set -x for displaying expanded values"
set -x
fi

run