Skip to content

Commit

Permalink
update lib common
Browse files Browse the repository at this point in the history
  • Loading branch information
shizunge committed Jan 28, 2024
1 parent 50c0ddf commit ebb8c6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ time_elapsed_since() {
_time_elapsed_between "$(date +%s)" "${START_TIME}"
}

add_uniq_to_list() {
add_unique_to_list() {
local OLD_LIST="${1}"
local NEW_ITEM="${2}"
[ -z "${OLD_LIST}" ] && echo "${NEW_ITEM}" && return 0
echo -e "${OLD_LIST}\n${NEW_ITEM}" | sort | uniq
}

Expand Down

0 comments on commit ebb8c6a

Please sign in to comment.