bimagic 1.4.4 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bimagic +37 -12
  2. package/package.json +1 -1
package/bimagic CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- VERSION="v1.4.4"
3
+ VERSION="v1.4.5"
4
4
 
5
5
  if [[ "$1" == "--version" || "$1" == "-v" ]]; then
6
6
  echo "Bimagic Git Wizard $VERSION"
@@ -53,7 +53,7 @@ BLUE=$(get_ansi_esc "$BIMAGIC_SECONDARY")
53
53
  PURPLE=$(get_ansi_esc "$BIMAGIC_PRIMARY")
54
54
  CYAN=$(get_ansi_esc "$BIMAGIC_INFO")
55
55
  GRAY=$(get_ansi_esc "$BIMAGIC_MUTED")
56
- NC='\033[0m' # No Color
56
+ NC=$(echo -e "\033[0m") # No Color
57
57
 
58
58
  # Function to draw a progress bar
59
59
  draw_progress_bar() {
@@ -246,15 +246,39 @@ STATUS: $status"
246
246
 
247
247
  generate_bar() {
248
248
  local percentage=$1
249
- local bar=""
249
+ local width=20
250
+
250
251
  # Convert float to integer for bar calculation
251
252
  local int_percentage=${percentage%.*}
252
- local bars=$((int_percentage / 2)) # Each █ represents 2%
253
+ # Safety check for integer conversion
254
+ if [[ ! "$int_percentage" =~ ^[0-9]+$ ]]; then int_percentage=0; fi
255
+ [[ $int_percentage -gt 100 ]] && int_percentage=100
256
+
257
+ local filled=$((int_percentage * width / 100))
258
+ local empty=$((width - filled))
253
259
 
254
- for ((i = 0; i < bars; i++)); do
255
- bar+=""
260
+ # Pre-get theme colors for the gradient
261
+ local c1=$(get_ansi_esc "$BANNER_COLOR_1")
262
+ local c2=$(get_ansi_esc "$BANNER_COLOR_2")
263
+ local c3=$(get_ansi_esc "$BANNER_COLOR_3")
264
+ local c4=$(get_ansi_esc "$BANNER_COLOR_4")
265
+ local c5=$(get_ansi_esc "$BANNER_COLOR_5")
266
+ local colors=("$c1" "$c2" "$c3" "$c4" "$c5")
267
+ local gray=$(get_ansi_esc "$BIMAGIC_MUTED")
268
+
269
+ local bar="${gray}[${NC}"
270
+ for ((i = 0; i < filled; i++)); do
271
+ local color_idx=$(( i * 5 / width ))
272
+ bar+="${colors[$color_idx]}█"
273
+ done
274
+
275
+ bar+="$gray"
276
+ for ((i = 0; i < empty; i++)); do
277
+ bar+="░"
256
278
  done
257
- echo "$bar"
279
+ bar+="]${NC}"
280
+
281
+ echo -e "$bar"
258
282
  }
259
283
 
260
284
  # Function to get contributor statistics
@@ -363,10 +387,11 @@ show_contributor_stats() {
363
387
  # Clean up author name
364
388
  author=$(echo "$author" | sed 's/^ *//;s/ *$//')
365
389
 
366
- # Generate bar (max 50 characters for 100%)
390
+ # Generate themed bar
367
391
  local bar=$(generate_bar "$percentage")
368
392
 
369
- printf "% -15s %-25s %5.1f%% (%d lines)\n" \
393
+ # Display entry with theme colors
394
+ printf "${BLUE}%-15s${NC} %s ${YELLOW}%5.1f%%${NC} (${CYAN}%d lines${NC})\n" \
370
395
  "$author" "$bar" "$percentage" "$lines"
371
396
 
372
397
  # Track most active (most commits)
@@ -389,14 +414,14 @@ show_contributor_stats() {
389
414
  echo
390
415
  echo -e "${CYAN}Highlights:${NC}"
391
416
  if [[ -n "$most_active_author" ]]; then
392
- echo -e "${BLUE}Most Active:${NC} $most_active_author ($most_commits commits)"
417
+ echo -e "${BLUE}Most Active:${NC} ${PURPLE}$most_active_author${NC} (${YELLOW}$most_commits commits${NC})"
393
418
  fi
394
419
  if [[ -n "$most_productive_author" ]]; then
395
- echo -e "${BLUE}Most Productive:${NC} $most_productive_author ($highest_avg lines/commit)"
420
+ echo -e "${BLUE}Most Productive:${NC} ${PURPLE}$most_productive_author${NC} (${YELLOW}$highest_avg lines/commit${NC})"
396
421
  fi
397
422
 
398
423
  local total_contributors=$(echo "$stats" | wc -l)
399
- echo -e "${BLUE}Total Contributors:${NC} $total_contributors"
424
+ echo -e "${BLUE}Total Contributors:${NC} ${YELLOW}$total_contributors${NC}"
400
425
  }
401
426
 
402
427
  # Function to clone a repository (Standard or Interactive)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimagic",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "A powerful Bash-based Git automation tool that simplifies your GitHub workflow.",
5
5
  "bin": {
6
6
  "bimagic": "./bimagic",