Skip to content

Commit ca5a2da

Browse files
committed
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1 parent c4b73af commit ca5a2da

File tree

7 files changed

+23
-9
lines changed

7 files changed

+23
-9
lines changed

bin/ent

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ RUN() {
3030
cmd=$(_resolve_alias "$cmd")
3131

3232
shift
33+
34+
[ "$ENTANDO_ENT_TRACE" == "true" ] && set -x
35+
3336
case "$cmd" in
3437
"version") #H: shows the version of the current ent
3538
which_ent version

bin/mod/ent-help

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ cd ..
8585
echo -e " --profile|-p {profile} forces the use of the given profile"
8686
echo -e " --no-profile|-P forces the use of no profile"
8787
echo -e " --debug|-d enables the debug mode for some command"
88+
echo -e " --trace enables shell level instruction trace"
8889
echo -e " --color disables the explicit suppression of the colors for some command"
8990

9091
echo ""

bin/mod/ent-profile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,15 @@ select_profile_item() {
365365

366366
stdin_to_arr $'\n\r' LST < <(list_profile_items "$type" "$pattern" "$parent")
367367

368-
if [[ "${#LST[@]}" -le 0 && "$dotdot" == "false" ]]; then
368+
if [[ "${#LST[@]}" -le 0 || -z "${LST[0]}" ]] && [[ "$dotdot" == "false" ]]; then
369369
# No match
370370
_tmp_result=""
371371
return 1
372372
fi
373+
374+
echo "#######################################################"
375+
echo "#######################################################"
376+
echo "#######################################################"
373377

374378
# shellcheck disable=SC2076 disable=SC2199
375379
if [[ " ${LST[@]} " =~ " ${pattern} " && "$dotdot" == "false" ]]; then

s/_base.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,17 +437,22 @@ parse_global_args() {
437437
shift;((ENTANDO_CONSUMED_ARGS++))
438438
ENTANDO_CLI_FORCE_COLORS=true
439439
;;
440-
"-d" | "--debug")
440+
"--debug")
441441
shift;((ENTANDO_CONSUMED_ARGS++))
442442
ENTANDO_ENT_DEBUG=true
443443
;;
444+
"--trace")
445+
shift;((ENTANDO_CONSUMED_ARGS++))
446+
ENTANDO_ENT_TRACE=true
447+
;;
444448
*)
445449
break
446450
;;
447451
esac
448452
done
449453

450454
export ENTANDO_ENT_DEBUG
455+
export ENTANDO_ENT_TRACE
451456
export ENTANDO_ENT_FORCE_PROFILE
452457
export ENTANDO_ENT_FORCE_PROFILE_SUB
453458
}

s/_conf.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ TMP_CLI_VERSION="$(
133133
ENTANDO_MANIFEST_CLI_VERSION="${ENTANDO_CLI_VERSION:-"$TMP_CLI_VERSION"}"
134134
ENTANDO_CLI_VERSION="${TMP_CLI_VERSION:-"$ENTANDO_MANIFEST_CLI_VERSION"}"
135135

136-
137136
ENTANDO_MANIFEST_RELEASE="$ENTANDO_RELEASE"
138137
TMP_CLI_VERSION="$(
139138
cd "$ENTANDO_ENT_HOME/dist" &> /dev/null || exit 1

s/utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,10 @@ select_one() {
441441
done
442442
${ALL:-false} && echo "a) all"
443443
echo "q) to quit"
444-
444+
445445
while true; do
446446
printf "%s" "$P"
447-
set_or_ask "SELECTED" "" ""
447+
set_or_ask SELECTED "" ""
448448
[[ "$SELECTED" == "q" ]] && EXIT_UE "User interrupted"
449449
[[ ! "$SELECTED" =~ ^[0-9]+$ ]] && continue
450450
[[ "$SELECTED" -gt 0 && "$SELECTED" -lt "$i" ]] && break

test/integration/test-int-profiles.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ test_profile_use() {
1010
_test_profile.cleanup
1111

1212
( _IT "should create and use the valid profile"
13-
1413
ent profile new "$TEST_PROFILE" "$TEST_PROFILE" "$TEST_PROFILE"
1514

16-
_ASSERT -v current-profile "$(_test_profile.get_current_profile)" = "$TEST_PROFILE"
15+
_ASSERT -v current-profile "|$(_test_profile.get_current_profile)|" = "|$TEST_PROFILE|"
1716

1817
ent config TEST_VAR "<BASE>"
1918
_ASSERT -v TEST_VAR "$(ent config TEST_VAR)" = "<BASE>"
@@ -51,9 +50,12 @@ test_profile_use() {
5150
}
5251

5352
_test_profile.get_current_profile() {
54-
ent status | grep "PROFILE:" | sed 's/.*PROFILE:\s*//'
53+
echo "########################################################################" 1>&2
54+
ent status 1>&2
55+
echo "########################################################################" 1>&2
56+
ent status | grep "PROFILE:" | sed 's/.*PROFILE:[[:space:]]*//'
5557
}
5658

5759
_test_profile.cleanup() {
58-
ent profile delete "$TEST_PROFILE" --yes &>/dev/null
60+
ent profile delete "$TEST_PROFILE" --yes #&>/dev/null
5961
}

0 commit comments

Comments
 (0)