Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaw353 authored Nov 10, 2024
1 parent f5bf4fb commit 4bf34f0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions dotfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ while [[ $# -gt 0 ]]; do
esac
done

# Function to display task status
function _task {
if [[ $TASK != "" ]]; then
# Displays the current task or updates it
function _display_task {
local task_message="$1"
if [[ -n $TASK ]]; then
# Update the previous task's status as done
printf "${OVERWRITE}${LGREEN} [✓] ${LGREEN}${TASK}${RESTORE}\n"
fi
TASK=$1
TASK="$task_message"
printf "${LBLACK} [ ] ${TASK}${RESTORE}\n"
}

Expand Down Expand Up @@ -120,12 +122,16 @@ function _cmd {
exit 1
}

# Clears the current task
function _clear_task {
TASK=""
}

# Marks the task as done
function _task_done {
printf "${OVERWRITE}${LGREEN} [✓] ${LGREEN}${TASK}${RESTORE}\n"
if [[ -n $TASK ]]; then
printf "${OVERWRITE}${LGREEN} [✓] ${LGREEN}${TASK}${RESTORE}\n"
fi
_clear_task
}

Expand Down

0 comments on commit 4bf34f0

Please sign in to comment.