Skip to content

Commit

Permalink
bug fixed: ./bake get -h 会显示:当前执行命令是:./bake _root get -h ,因为_root特殊的…
Browse files Browse the repository at this point in the history
…命令未做判断,已修正
  • Loading branch information
chen56 committed Mar 26, 2024
1 parent 8ddc198 commit 8c70b03
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bake.bash
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ bake._show_cmd_help() {

echo

echo "Currently running: $(bake._pwd)/$BAKE_FILE $cmd $@"
if [[ "$cmd" == "_root" ]] ;then
echo "Currently running: $(bake._pwd)/$BAKE_FILE $@"
else
echo "Currently running: $(bake._pwd)/$BAKE_FILE $cmd $@"
fi

echo

Expand Down Expand Up @@ -714,10 +718,9 @@ bake.go() {
bake._show_cmd_help "$cmd" "$@"
return 0
fi
if [[ "$log" != "" ]]; then LOG="$log"; fi

# # parse opts
if ! declare -f "$cmd" >/dev/null 2>&1; then
# if fileExist then show help
if ! declare -F "$cmd" | grep "$cmd" &>/dev/null 2>&1; then
if [[ "${_cmdTree["$cmd"]}" == "PARENT_CMD_NOT_FUNC" ]]; then
bake._show_cmd_help "$cmd" "$@"
return 0
Expand Down

0 comments on commit 8c70b03

Please sign in to comment.