From a61b34400b9d4d00fea780a7744db40517242ef5 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 13 Jan 2025 17:21:28 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(scripts)=20improve=20script?= =?UTF-8?q?=20portability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improved script portability by switching to `/usr/bin/env bash`, ensuring better support across environments where `bash` may not be the default shell. --- bin/install-external-secrets.sh | 2 +- bin/install-hooks.sh | 2 +- bin/start-kind.sh | 2 +- bin/update-git-submodule.sh | 2 +- bin/update-keys.sh | 2 +- bin/validate-helm-configuration.sh | 2 +- src/helm/meet/generate-readme.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/install-external-secrets.sh b/bin/install-external-secrets.sh index 620523b7..6f334ef3 100755 --- a/bin/install-external-secrets.sh +++ b/bin/install-external-secrets.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -o errexit CURRENT_DIR=$(pwd) diff --git a/bin/install-hooks.sh b/bin/install-hooks.sh index 7d1c790c..fef9219c 100755 --- a/bin/install-hooks.sh +++ b/bin/install-hooks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash mkdir -p "$(dirname -- "${BASH_SOURCE[0]}")/../.git/hooks/" PRE_COMMIT_FILE="$(dirname -- "${BASH_SOURCE[0]}")/../.git/hooks/pre-commit" diff --git a/bin/start-kind.sh b/bin/start-kind.sh index 326e61cd..015ca778 100755 --- a/bin/start-kind.sh +++ b/bin/start-kind.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash curl https://raw.githubusercontent.com/numerique-gouv/tools/refs/heads/main/kind/create_cluster.sh | bash -s -- meet diff --git a/bin/update-git-submodule.sh b/bin/update-git-submodule.sh index 670cfef8..5ec8ff05 100755 --- a/bin/update-git-submodule.sh +++ b/bin/update-git-submodule.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash git submodule update --init --recursive git submodule foreach 'git fetch origin; git checkout $(git rev-parse --abbrev-ref HEAD); git reset --hard origin/$(git rev-parse --abbrev-ref HEAD); git submodule update --recursive; git clean -dfx' diff --git a/bin/update-keys.sh b/bin/update-keys.sh index 43e2f9d4..6256c4ad 100644 --- a/bin/update-keys.sh +++ b/bin/update-keys.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash find . -name "*.enc.*" -exec sops updatekeys -y {} \; diff --git a/bin/validate-helm-configuration.sh b/bin/validate-helm-configuration.sh index 4374ca29..3d155664 100755 --- a/bin/validate-helm-configuration.sh +++ b/bin/validate-helm-configuration.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/src/helm/meet/generate-readme.sh b/src/helm/meet/generate-readme.sh index d5bbe2c0..f8060225 100755 --- a/src/helm/meet/generate-readme.sh +++ b/src/helm/meet/generate-readme.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash docker image ls | grep readme-generator-for-helm if [ "$?" -ne "0" ]; then