Skip to content

Commit afedfdc

Browse files
jdosstashian
authored andcommitted
Update scripts/package-repo-import.sh
Co-authored-by: Carl Tashian <[email protected]>
1 parent 648e2ad commit afedfdc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/package-repo-import.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ check_package() {
2020
local REPO="${1}"
2121
local VER="${2}"
2222
if [ ! -f /tmp/version-deleted.stamp ]; then
23-
gcloud artifacts versions list --repository "${REPO}" --location "${GCLOUD_LOCATION}" --package "${PACKAGE}" \
24-
--filter "VERSION:${VER}" --format json 2> /dev/null |jq -re '.[].name?' >/dev/null 2>&1 || EXITCODE=$?
23+
gcloud artifacts versions list \
24+
--repository "${REPO}" \
25+
--location "${GCLOUD_LOCATION}" \
26+
--package "${PACKAGE}" \
27+
--filter "VERSION:${VER}" \
28+
--format json 2> /dev/null \
29+
| jq -re '.[].name?' >/dev/null 2>&1 \
30+
|| EXITCODE=$?
2531
if [[ "${EXITCODE}" -eq 0 ]]; then
2632
echo "Package version already exists. Removing it..."
2733
gcloud artifacts versions delete --quiet "${VER}" --package "${PACKAGE}" --repository "${REPO}" --location "${GCLOUD_LOCATION}"

0 commit comments

Comments
 (0)