Fix bug: review log (#32)

* Make the cards look more like cards.

* travis

* travis

* travis 2

* Fix bug: review log

* travis 3

Co-authored-by: Bryan Jenks <bryanjenks@protonmail.com>
This commit is contained in:
Gustavo 2020-07-19 21:12:21 -04:00 committed by GitHub
parent e087cefecd
commit 96762bab04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

11
flash
View File

@ -230,7 +230,9 @@ esac
# The top part of the flash display so that code is not duplicated twice
print_head(){
QUESTION=$(echo "${q[1]}" | fold -w 59)
QUESTION=$(echo "${q[1]}" | fold -w 59)
echo -e "${WHITEBG} Fla.sh - Flash Cards In Your Terminal ${NC}
${ORANGE}${BOLD} Current Deck:${BOLD}${NC}\t$(basename -s .csv "$CURRENT_DECK")
${ORANGE}${BOLD}Cards Reviewed:${BOLD}${NC}\t$COUNTER
@ -249,8 +251,7 @@ add_usage_entry(){
if [ ! "$COUNTER" = 0 ]; then
# Create a New Entry
TIME_STAMP=$(date --rfc-3339=seconds)
REVIEWED_DECK="$(echo "$EXAMPLE_DECK" | awk -F/ '{print $7}')"
printf -v ENTRY "TimeStamp: %s Deck: %s cardsReviewed: %s" "$TIME_STAMP" "$REVIEWED_DECK" "$COUNTER"
printf -v ENTRY "TimeStamp: %s Deck: %s cardsReviewed: %s" "$TIME_STAMP" "$CURRENT_DECK" "$COUNTER"
echo "$ENTRY" >> "$REVIEW_LOG"
fi
}
@ -281,7 +282,9 @@ ${LGREY}──────────────── Press [Enter] to contin
if [ "$NEXT" = q ] || [ "$NEXT" = Q ]; then
add_usage_entry && cd "$PWD" && clear && exit 0
fi
ANSWER=$(echo "${q[2]}" | fold -w 59)
ANSWER=$(echo "${q[2]}" | fold -w 59)
echo -e "___________________________________________________________
$(if [ ${#ANSWER} -lt 59 ]; then printf "%$(( ( 59 - ${#ANSWER} ) / 2 ))s"; fi)$ANSWER