From 5741e0ecb7d31fe1f749ebf1848f3309f1bc4c3e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 10 Apr 2024 15:08:20 +0200 Subject: [PATCH] sh tasks: Run with set -e This ensures that the task doesn't continue when an error happened. This is also best practice in bash. --- tasks/install_shell.sh | 3 +++ tasks/version_shell.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tasks/install_shell.sh b/tasks/install_shell.sh index cfd6df8f3..9adf1c419 100644 --- a/tasks/install_shell.sh +++ b/tasks/install_shell.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash + +set -e + # Install puppet-agent as a task # # From https://github.com/petems/puppet-install-shell/blob/master/install_puppet_5_agent.sh diff --git a/tasks/version_shell.sh b/tasks/version_shell.sh index 9cf359028..d0e4402b8 100644 --- a/tasks/version_shell.sh +++ b/tasks/version_shell.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + loc=/opt/puppetlabs/puppet/VERSION if test -f $loc; then echo "{\"version\":\"$(cat $loc)\",\"source\":\"${loc}\"}"