mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 02:35:30 +00:00
Remove commas, and block scalar folded backslashes #84
This commit is contained in:
parent
5b6c3ab114
commit
270eae5fc9
7
lib.sh
7
lib.sh
|
@ -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}" \
|
||||
|
|
Loading…
Reference in a new issue