From ec7a7aa6ba058d086b91d5f23739b9d71714fc34 Mon Sep 17 00:00:00 2001 From: alexander-demicev Date: Tue, 9 Apr 2024 12:37:53 +0200 Subject: [PATCH] Use absolute path in update scripts Signed-off-by: alexander-demicev --- hack/update-helm-repo.sh | 4 +++- hack/update-plugin-yaml.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hack/update-helm-repo.sh b/hack/update-helm-repo.sh index 8c74a375f..e457368bf 100755 --- a/hack/update-helm-repo.sh +++ b/hack/update-helm-repo.sh @@ -3,6 +3,8 @@ set -o errexit set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +# Resolve the absolute path of the directory containing the script +SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +REPO_ROOT="$SCRIPT_DIR/.." cd $REPO_ROOT/hack/chart-update; go run . -release-tag=$1; cd - diff --git a/hack/update-plugin-yaml.sh b/hack/update-plugin-yaml.sh index 0caab0bb4..3264315b2 100755 --- a/hack/update-plugin-yaml.sh +++ b/hack/update-plugin-yaml.sh @@ -3,6 +3,8 @@ set -o errexit set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +# Resolve the absolute path of the directory containing the script +SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +REPO_ROOT="$SCRIPT_DIR/.." -docker run --rm -v $REPO_ROOT:/home/app ghcr.io/rajatjindal/krew-release-bot:v0.0.46 krew-release-bot template --tag $1 --template-file .krew.yaml > $REPO_ROOT/plugins/clusterctl-operator.yaml \ No newline at end of file +docker run --rm -v "$REPO_ROOT":/home/app ghcr.io/rajatjindal/krew-release-bot:v0.0.46 krew-release-bot template --tag "$1" --template-file .krew.yaml > "$REPO_ROOT"/plugins/clusterctl-operator.yaml