Skip to content

Commit d81dee7

Browse files
committed
Address CodeRabbit review: fix error logging and test paths
- Change log_info to log_error in completion failure path to avoid misleading success marker - Use paths with spaces in test fixtures to exercise zsh fpath quoting
1 parent 933df02 commit d81dee7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/commands/completion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _completion_asset_path() {
1414
done
1515

1616
log_error "Could not find $shell completion asset under: $GTR_DIR"
17-
log_info "Expected either a source checkout (completions/) or a Homebrew install layout."
17+
log_error "Expected either a source checkout (completions/) or a Homebrew install layout."
1818
return 1
1919
}
2020

tests/completion.bats

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ log_error() { printf '%s\n' "$*" >&2; }
77
log_info() { printf '%s\n' "$*" >&2; }
88

99
setup() {
10-
TEST_GTR_DIR="$(mktemp -d)"
10+
TEST_ROOT="$(mktemp -d)"
11+
TEST_GTR_DIR="$TEST_ROOT/prefix with spaces"
12+
mkdir -p "$TEST_GTR_DIR"
1113
export GTR_DIR="$TEST_GTR_DIR"
1214
# shellcheck disable=SC1091
1315
. "$PROJECT_ROOT/lib/commands/completion.sh"
1416
}
1517

1618
teardown() {
17-
rm -rf "$TEST_GTR_DIR"
19+
rm -rf "$TEST_ROOT"
1820
}
1921

2022
write_test_file() {

0 commit comments

Comments
 (0)