3
0
Fork 0
forked from mirrors/nixpkgs

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
This commit is contained in:
Yaya 2023-01-03 13:49:07 +01:00 committed by GitHub
parent f61d4d346b
commit 5e96eb14ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
'';
};