From af167ccfb0c95401e506871543584c73b02c4850 Mon Sep 17 00:00:00 2001 From: Edu4rdSHL Date: Fri, 11 Mar 2022 15:32:39 -0500 Subject: [PATCH] Update builder.sh Signed-off-by: Edu4rdSHL --- builder.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/builder.sh b/builder.sh index a2ed29e..76dacfc 100755 --- a/builder.sh +++ b/builder.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# Rusolver releaser NAME="fhc" LINUX_TARGET="x86_64-unknown-linux-musl" @@ -10,6 +9,14 @@ AARCH_TARGET="aarch64-unknown-linux-gnu" OSX_TARGET="x86_64-apple-darwin" MANPAGE_DIR="./$NAME.1" +if ! systemctl is-active docker >/dev/null 2>&1; then + echo "Docker is not running. Starting docker." + if ! sudo systemctl start docker; then + echo "Failed to start docker." + exit 1 + fi +fi + # Linux build echo "Building Linux artifact." if cargo build -q --release --target="$LINUX_TARGET"; then @@ -87,18 +94,9 @@ else echo "Please install the help2man package." fi -# if command -v git >/dev/null; then -# git add . -# git commit -m "Bump version." -# git push -# fi - -#echo "Uploading crate to crates.io..." -#if cargo publish --no-verify > /dev/null; then -# echo "Crate uploaded." -#else -# echo "An error has occurred while uploading the crate to crates.io." -# exit -#fi - -echo "All builds have passed!" +# Stop docker +echo "Stopping docker." +if ! sudo systemctl stop docker; then + echo "Failed to stop docker." + exit 1 +fi