Skip to content

Commit 42c720d

Browse files
committed
fix: linted claude statusline
1 parent 92fe7f3 commit 42c720d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

home/dot_claude/executable_statusline.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ yellow=$'\033[0;33m'
99
reset=$'\033[0m'
1010

1111
# Extract values using jq
12-
cwd=$(echo "$input" | jq -r '.workspace.current_dir')
13-
model=$(echo "$input" | jq -r '.model.display_name')
12+
cwd=$(echo "${input}" | jq -r '.workspace.current_dir')
13+
model=$(echo "${input}" | jq -r '.model.display_name')
1414

1515
# Get directory using starship
16-
dir=$(cd "$cwd" && starship module directory)
16+
dir=$(cd "${cwd}" && starship module directory)
1717

1818
# Check if we're in a git repo and get branch
1919
git_info=""
20-
if git -C "$cwd" rev-parse --git-dir >/dev/null 2>&1; then
21-
branch=$(git -C "$cwd" branch --show-current 2>/dev/null || echo "detached")
20+
if git -C "${cwd}" rev-parse --git-dir >/dev/null 2>&1; then
21+
branch=$(git -C "${cwd}" branch --show-current 2>/dev/null || echo "detached")
2222
git_info=" on ${magenta}${branch}${reset}"
2323
fi
2424

2525
# Calculate context window percentage
2626
context_info=""
27-
usage=$(echo "$input" | jq '.context_window.current_usage')
28-
if [ "$usage" != "null" ]; then
29-
current=$(echo "$usage" | jq '.input_tokens + .cache_creation_input_tokens + .cache_read_input_tokens')
30-
size=$(echo "$input" | jq '.context_window.context_window_size')
31-
if [ "$size" != "null" ] && [ "$size" != "0" ]; then
27+
usage=$(echo "${input}" | jq '.context_window.current_usage')
28+
if [[ ${usage} != "null" ]]; then
29+
current=$(echo "${usage}" | jq '.input_tokens + .cache_creation_input_tokens + .cache_read_input_tokens')
30+
size=$(echo "${input}" | jq '.context_window.context_window_size')
31+
if [[ ${size} != "null" ]] && [[ ${size} != "0" ]]; then
3232
pct=$((current * 100 / size))
3333
context_info=" | ${yellow}${pct}%${reset} ctx"
3434
fi
3535
fi
3636

3737
# Output status line
38-
printf "%s%s | %s%s\n" "$dir" "$git_info" "$model" "$context_info"
38+
printf "%s%s | %s%s\n" "${dir}" "${git_info}" "${model}" "${context_info}"

0 commit comments

Comments
 (0)