From 651fb4db339622c8b7041c24a8e9f896fe8025e1 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Thu, 14 Nov 2024 06:23:08 +0100 Subject: [PATCH] Review and linting suggestions --- src/scripts/merge_tools/mergiraf.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/scripts/merge_tools/mergiraf.sh b/src/scripts/merge_tools/mergiraf.sh index 09122127a5..8784bd06ce 100755 --- a/src/scripts/merge_tools/mergiraf.sh +++ b/src/scripts/merge_tools/mergiraf.sh @@ -26,17 +26,17 @@ SCRIPT_PATH="$(dirname "$0")"; SCRIPT_PATH="$(eval "cd \"$SCRIPT_PATH\" && pwd") ROOT_PATH="$(realpath "${SCRIPT_PATH}/../../../")" mergiraf_relativepath=bin/mergiraf mergiraf_absolutepath="${ROOT_PATH}/${mergiraf_relativepath}" -mkdir -p ${ROOT_PATH}/bin +mkdir -p "${ROOT_PATH}/bin" -if [ ! -e $mergiraf_absolutepath ]; then +if [ ! -e "$mergiraf_absolutepath" ]; then ARCH=$(uname -m) if [[ "$ARCH" == x86_64* ]]; then ARCH="x86_64" - elif [[ "$ARCH" == i*86 ]]; then - echo "No mergiraf binaries for architecture $ARCH" - exit 2 elif [[ "$ARCH" == arm* ]]; then ARCH="aarch64" + else + echo "No mergiraf binaries for architecture $ARCH" + exit 2 fi if [[ $OSTYPE == 'darwin'* ]]; then VENDOR="apple-darwin" @@ -45,9 +45,9 @@ if [ ! -e $mergiraf_absolutepath ]; then fi FULL_ARCH="${ARCH}-${VENDOR}" - wget https://codeberg.org/mergiraf/mergiraf/releases/download/v${MERGIRAF_VERSION}/mergiraf_${FULL_ARCH}.tar.gz -O ${ROOT_PATH}/bin/mergiraf.tar.gz - tar -zxf ${ROOT_PATH}/bin/mergiraf.tar.gz -C ${ROOT_PATH}/bin/ - rm ${ROOT_PATH}/bin/mergiraf.tar.gz + wget "https://codeberg.org/mergiraf/mergiraf/releases/download/v${MERGIRAF_VERSION}/mergiraf_${FULL_ARCH}.tar.gz" -O "${ROOT_PATH}/bin/mergiraf.tar.gz" + tar -zxf "${ROOT_PATH}/bin/mergiraf.tar.gz" -C "${ROOT_PATH}/bin/" + rm "${ROOT_PATH}/bin/mergiraf.tar.gz" fi clone_dir=$1 @@ -57,8 +57,8 @@ branch2=$3 cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; } # set up mergiraf driver -git config --global merge.mergiraf.name mergiraf -git config --global merge.mergiraf.driver "${mergiraf_absolutepath} merge --git %O %A %B -s %S -x %X -y %Y -p %P" +git config merge.mergiraf.name mergiraf +git config merge.mergiraf.driver "${mergiraf_absolutepath} merge --git %O %A %B -s %S -x %X -y %Y -p %P" $(mergiraf_absolutepath) languages --gitattributes >> .gitattributes # perform merge