Skip to content

Commit

Permalink
sh tasks: Run with set -e
Browse files Browse the repository at this point in the history
This ensures that the task doesn't continue when an error happened. This
is also best practice in bash.
  • Loading branch information
bastelfreak committed Apr 10, 2024
1 parent 26cb2e4 commit 5741e0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/install_shell.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions tasks/version_shell.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

loc=/opt/puppetlabs/puppet/VERSION
if test -f $loc; then
echo "{\"version\":\"$(cat $loc)\",\"source\":\"${loc}\"}"
Expand Down

0 comments on commit 5741e0e

Please sign in to comment.