From 6bf063b92ff41520e97be17b5f65ee1559d7f8b4 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 14 Jul 2024 21:35:08 +0300 Subject: [PATCH] bin/build*: Check that required binaries are present --- bin/build-debian.sh | 5 +++++ bin/build-linux-x64.sh | 15 +++++++++++++++ bin/build-win-x64.sh | 5 +++++ bin/build.sh | 22 ++++++++++++++++++++++ 4 files changed, 47 insertions(+) diff --git a/bin/build-debian.sh b/bin/build-debian.sh index 7f246ade3..03918fc0f 100755 --- a/bin/build-debian.sh +++ b/bin/build-debian.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if ! command -v dpkg-deb &> /dev/null; then + echo "Missing command: dpkg-deb" + exit 1 +fi + echo "Packaging debian x64 distribution..." VERSION=`jq -r ".version" package.json` diff --git a/bin/build-linux-x64.sh b/bin/build-linux-x64.sh index 888720a19..fd5b02dda 100755 --- a/bin/build-linux-x64.sh +++ b/bin/build-linux-x64.sh @@ -1,5 +1,20 @@ #!/usr/bin/env bash +if ! command -v jq &> /dev/null; then + echo "Missing command: jq" + exit 1 +fi + +if ! command -v fakeroot &> /dev/null; then + echo "Missing command: fakeroot" + exit 1 +fi + +if ! command -v dpkg-deb &> /dev/null; then + echo "Missing command: dpkg-deb" + exit 1 +fi + SRC_DIR=./dist/trilium-linux-x64-src [ "$1" != "DONTCOPY" ] && ./bin/copy-trilium.sh "$SRC_DIR" diff --git a/bin/build-win-x64.sh b/bin/build-win-x64.sh index 37bc28137..ad359ccb6 100755 --- a/bin/build-win-x64.sh +++ b/bin/build-win-x64.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if ! command -v wine &> /dev/null; then + echo "Missing command: wine" + exit 1 +fi + SRC_DIR=./dist/trilium-windows-x64-src if [ "$1" != "DONTCOPY" ] diff --git a/bin/build.sh b/bin/build.sh index 6092b2011..6a738f1a5 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,5 +1,27 @@ #!/usr/bin/env bash +set -e + +if ! command -v jq &> /dev/null; then + echo "Missing command: jq" + exit 1 +fi + +if ! command -v fakeroot &> /dev/null; then + echo "Missing command: fakeroot" + exit 1 +fi + +if ! command -v dpkg-deb &> /dev/null; then + echo "Missing command: dpkg-deb" + exit 1 +fi + +if ! command -v wine &> /dev/null; then + echo "Missing command: wine" + exit 1 +fi + echo "Deleting existing builds" rm -rf dist/*