Skip to content

Commit

Permalink
Remove commas, and block scalar folded backslashes #84
Browse files Browse the repository at this point in the history
  • Loading branch information
awalsh128 committed Feb 5, 2023
1 parent 5b6c3ab commit 270eae5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@ function log_err { >&2 echo "$(date +%H:%M:%S)" "${@}"; }
function log_empty_line { echo ""; }

###############################################################################
# Sorts given packages by name and split on commas.
# Sorts given packages by name and split on commas and/or spaces.
# Arguments:
# The comma delimited list of packages.
# The comma and/or space delimited list of packages.
# Returns:
# Sorted list of space delimited packages.
###############################################################################
function normalize_package_list {
local stripped=$(echo "${1}" | sed 's/,//g')
# Remove commas, and block scalar folded backslashes.
local stripped=$(echo "${1}" | sed 's/[,\]/ /g')
# Remove extraneous spaces at the middle, beginning, and end.
local trimmed="$(\
echo "${stripped}" \
Expand Down

0 comments on commit 270eae5

Please sign in to comment.