Skip to content

Conversation

BarbUk
Copy link
Contributor

@BarbUk BarbUk commented Feb 8, 2024

Description

When using the lib to display the command duration, the dynamic clock is off by 1.

Motivation and Context

This change is required to have a dynamic clock that output the correct clock hand.

How Has This Been Tested?

Before:

for second in {1..15}; do     
  clock_hand=$(printf '%x' $(((${1:-${second}} % 12) + 144)))
  printf '%b' "\xf0\x9f\x95\x$clock_hand"
done

🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕐🕑🕒🕓

After:

for second in {1..15}; do     
  clock_hand=$(printf '%x' $((((${1:-${second}} -1 ) % 12) + 144)))
  printf '%b' "\xf0\x9f\x95\x$clock_hand"
done

🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕐🕑🕒

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@BarbUk BarbUk marked this pull request as ready for review February 8, 2024 12:50
@seefood seefood merged commit b55db47 into Bash-it:master Nov 6, 2024
@BarbUk BarbUk deleted the fix/clock_hand branch November 6, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants