summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorYaya <mak@nyantec.com>2023-01-03 13:49:07 +0100
committerGitHub <noreply@github.com>2023-01-03 13:49:07 +0100
commit5e96eb14ce38fe9067fe5d8545379560a0c331c4 (patch)
tree25ba64fe72ef023cd3204e8d9b90e6428663f675 /nixos
parentf61d4d346bcacb4967a4f259280682279e9db7c5 (diff)
downloadnixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.tar
nixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.tar.gz
nixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.tar.bz2
nixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.tar.lz
nixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.tar.xz
nixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.tar.zst
nixpkgs-5e96eb14ce38fe9067fe5d8545379560a0c331c4.zip
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
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-apps/snipe-it.nix5
1 files 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 314a69a73a8..93b0aafab64 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
         '';
     };