From 36c79c949193dac3a2c582a5114aa654b12799e8 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Fri, 14 Dec 2018 19:00:19 -0500 Subject: [PATCH] cleanup --- build-deb.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build-deb.sh b/build-deb.sh index 8d701910d6..fd14fc17db 100755 --- a/build-deb.sh +++ b/build-deb.sh @@ -3,6 +3,7 @@ # Build a Jellyfin .deb file with Docker on Linux # Places the output .deb file in the parent directory +set -o errexit set -o xtrace set -o nounset @@ -11,12 +12,13 @@ current_user="`whoami`" image_name="jellyfin-debuild" cleanup() { + set +o errexit docker image rm $image_name --force - test -d "$package_temporary_dir" && rm -r "$package_temporary_dir" + rm -rf "$package_temporary_dir" } trap cleanup EXIT INT -docker build . -t "$image_name" -f ./Dockerfile.debian_package || exit 1 -docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /dist /temp/ || exit 1 -sudo chown -R "$current_user" "$package_temporary_dir" || exit 1 -mv "$package_temporary_dir"/dist/*.deb ../ || exit 1 +docker build . -t "$image_name" -f ./Dockerfile.debian_package +docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /dist /temp/ +sudo chown -R "$current_user" "$package_temporary_dir" +mv "$package_temporary_dir"/dist/*.deb ../