Sort by string length for tags
This commit is contained in:
parent
c02916194f
commit
4dc93d65a4
|
@ -166,7 +166,10 @@ function copy-image() {
|
|||
|
||||
function list-tags() {
|
||||
local image="${1:-}"
|
||||
local raw="$(${SKOPEO} list-tags --retry-times "${RETRY}" --no-creds --tls-verify=false "docker://${image}" | ${JQ} -r '.Tags[]' | sort)"
|
||||
local raw="$(${SKOPEO} list-tags --retry-times "${RETRY}" --no-creds --tls-verify=false "docker://${image}" | ${JQ} -r '.Tags[]')"
|
||||
|
||||
# Sort by string length
|
||||
raw=$(echo "${raw}" | awk '{print length, $0}' | sort -n | awk '{print $2}')
|
||||
|
||||
if [[ "${FOCUS}" != "" ]]; then
|
||||
local skip=$(echo "${raw}" | grep -v -E "${FOCUS}")
|
||||
|
|
Loading…
Reference in New Issue