From 6461765cf7a32946fc4a9d3027b35d1af3330305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Sun, 22 Sep 2024 16:13:41 +0200 Subject: [PATCH] build: minor tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * call bash through env progrem * add more strict defaults * [ -> [[ Signed-off-by: Maciej Barć --- build/scripts/package.linux.sh | 11 +++++++---- build/scripts/package.osx-app.sh | 9 ++++++--- build/scripts/package.windows-portable.sh | 9 ++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/build/scripts/package.linux.sh b/build/scripts/package.linux.sh index 5eceffd6..5ffd5a27 100755 --- a/build/scripts/package.linux.sh +++ b/build/scripts/package.linux.sh @@ -1,13 +1,16 @@ -#!/bin/bash +#!/usr/bin/env bash set -e +set -o +set -u +set pipefail -if [ -z "$VERSION" ]; then +if [[ -z "$VERSION" ]]; then echo "Provide the version as environment variable VERSION" exit 1 fi -if [ -z "$RUNTIME" ]; then +if [[ -z "$RUNTIME" ]]; then echo "Provide the runtime as environment variable RUNTIME" exit 1 fi @@ -33,7 +36,7 @@ APPIMAGETOOL_URL=https://github.com/AppImage/appimagetool/releases/download/cont cd build -if [ ! -f "appimagetool" ]; then +if [[ ! -f "appimagetool" ]]; then curl -o appimagetool -L "$APPIMAGETOOL_URL" chmod +x appimagetool fi diff --git a/build/scripts/package.osx-app.sh b/build/scripts/package.osx-app.sh index 5d908956..4a50a860 100755 --- a/build/scripts/package.osx-app.sh +++ b/build/scripts/package.osx-app.sh @@ -1,13 +1,16 @@ -#!/bin/bash +#!/usr/bin/env bash set -e +set -o +set -u +set pipefail -if [ -z "$VERSION" ]; then +if [[ -z "$VERSION" ]]; then echo "Provide the version as environment variable VERSION" exit 1 fi -if [ -z "$RUNTIME" ]; then +if [[ -z "$RUNTIME" ]]; then echo "Provide the runtime as environment variable RUNTIME" exit 1 fi diff --git a/build/scripts/package.windows-portable.sh b/build/scripts/package.windows-portable.sh index cc5ee1bd..9ba29216 100755 --- a/build/scripts/package.windows-portable.sh +++ b/build/scripts/package.windows-portable.sh @@ -1,13 +1,16 @@ -#!/bin/bash +#!/usr/bin/env bash set -e +set -o +set -u +set pipefail -if [ -z "$VERSION" ]; then +if [[ -z "$VERSION" ]]; then echo "Provide the version as environment variable VERSION" exit 1 fi -if [ -z "$RUNTIME" ]; then +if [[ -z "$RUNTIME" ]]; then echo "Provide the runtime as environment variable RUNTIME" exit 1 fi