Skip to content

Commit f76de96

Browse files
committed
hide "set -x" into an option
"set -x" is only necessary for developers. With this patch, it can be set using the option -x when calling distribute.sh
1 parent 54814e1 commit f76de96

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

distribute.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ CBLUE="\x1b[34;01m"
6262
CGRAY="\x1b[30;01m"
6363
CRESET="\x1b[39;49;00m"
6464
DO_CLEAN_BUILD=0
65+
DO_SET_X=0
6566

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

74-
set -x
75-
7675
function try () {
7776
"$@" || exit -1
7877
}
@@ -210,6 +209,7 @@ function usage() {
210209
echo " -l Show a list of available modules"
211210
echo " -m 'mod1 mod2' Modules to include"
212211
echo " -f Restart from scratch (remove the current build)"
212+
echo " -x display expanded values (execute 'set -x')"
213213
echo
214214
exit 0
215215
}
@@ -615,7 +615,7 @@ function arm_deduplicate() {
615615

616616

617617
# Do the build
618-
while getopts ":hvlfm:d:s" opt; do
618+
while getopts ":hvlfxm:d:s" opt; do
619619
case $opt in
620620
h)
621621
usage
@@ -638,6 +638,9 @@ while getopts ":hvlfm:d:s" opt; do
638638
f)
639639
DO_CLEAN_BUILD=1
640640
;;
641+
x)
642+
DO_SET_X=1
643+
;;
641644
\?)
642645
echo "Invalid option: -$OPTARG" >&2
643646
exit 1
@@ -653,4 +656,9 @@ while getopts ":hvlfm:d:s" opt; do
653656
esac
654657
done
655658

659+
if [ $DO_SET_X -eq 1 ]; then
660+
info "Set -x for displaying expanded values"
661+
set -x
662+
fi
663+
656664
run

0 commit comments

Comments
 (0)