From 5e96eb14ce38fe9067fe5d8545379560a0c331c4 Mon Sep 17 00:00:00 2001 From: Yaya Date: Tue, 3 Jan 2023 13:49:07 +0100 Subject: [PATCH] nixos/snipe-it: Fix a bug in the setup script (#206869) The `snipe-it-setup.service` script exits with an error if the invalid_barcode.gif already exists at the destination, due to `set -euo pipefail` at the beginning of the script. This commit refactors the affected lines so that it no longer causes an error. Resolves #205791 --- nixos/modules/services/web-apps/snipe-it.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/snipe-it.nix b/nixos/modules/services/web-apps/snipe-it.nix index 314a69a73a87..93b0aafab64b 100644 --- a/nixos/modules/services/web-apps/snipe-it.nix +++ b/nixos/modules/services/web-apps/snipe-it.nix @@ -454,8 +454,9 @@ in { # A placeholder file for invalid barcodes invalid_barcode_location="${cfg.dataDir}/public/uploads/barcodes/invalid_barcode.gif" - [ ! -e "$invalid_barcode_location" ] \ - && cp ${snipe-it}/share/snipe-it/invalid_barcode.gif "$invalid_barcode_location" + if [ ! -e "$invalid_barcode_location" ]; then + cp ${snipe-it}/share/snipe-it/invalid_barcode.gif "$invalid_barcode_location" + fi ''; };