Skip to content

Commit

Permalink
Merge pull request #55 from kravciak/161
Browse files Browse the repository at this point in the history
Add safeguards to sync script
  • Loading branch information
jordojordo authored Jun 13, 2024
2 parents b0ff960 + 4c3c8bc commit 4ed03a5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/sync-charts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
BASE_DIR="$( cd $SCRIPT_DIR && cd .. & pwd)"
Expand Down Expand Up @@ -89,7 +90,7 @@ do
mkdir -p ./charts/${NAME}
mkdir -p ./extensions/${NAME}

# Get repository name, branch, and versions
# Get repository name, branch, and versions
REPO=$(jq -r ".extensions.\"${NAME}\".repo" manifest.json)
EXT_BRANCH=$(jq -r ".extensions.\"${NAME}\".branch" manifest.json)
VERSIONS=$(jq -r ".extensions.\"${NAME}\".versions[]" manifest.json)
Expand Down Expand Up @@ -134,7 +135,7 @@ do
CHART_FILE=./charts/${NAME}/${VERSION}/Chart.yaml

ICON=$(yq eval '.icon' ${CHART_FILE})

if [ -n "${ICON}" ]; then
# Downloading icon
ICON_FILE=$(basename $ICON)
Expand All @@ -154,7 +155,7 @@ do
else
sed -i.bak -e 's@icon:.*@icon: '"${NEW_ICON}"'@' ${CHART_FILE}
fi

rm -rf ${CHART_FILE}.bak

PKG_FILE=${BASE_DIR}/extensions/${NAME}/${VERSION}/plugin/package.json
Expand All @@ -168,7 +169,7 @@ do
echo " + Updating Helm index"

# --------------------------------------------------------------------------------
# Update the helm index just for this chart
# Update the helm index just for this chart
# --------------------------------------------------------------------------------
if [ -f "${HELM_INDEX}" ]; then
UPDATE="--merge ${HELM_INDEX}"
Expand Down

0 comments on commit 4ed03a5

Please sign in to comment.