diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 93d07cd..0a6d86d 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright 2023 Thomas de Grivel <thodg@kmx.io>
-set -e
+set -e -o pipefail
# Config
@@ -91,7 +91,6 @@ err () {
shpkg_log () {
SHPKG_NAME="$1"
shift
- set -o pipefail
shpkg_start_logging "${SHPKG_NAME}"
shpkg_redirect_err "$@" | tee -a "${SHPKG_LOG}"
}