From 28fb0a24ff20b45b3f2aeb7607792c3668ceb349 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 22 Oct 2021 14:47:54 +0200 Subject: [PATCH] Make <<>> fail if it cannot open a file By default, only a warning is printed and the script continues. Example of this situation: % novaboot non-existent --gen-only novaboot: Read /home/wsh/.config/novaboot novaboot: Effective options: non-existent --gen-only Can't open non-existent: No such file or directory at /home/wsh/src/novaboot/novaboot line 362. We do not add a test for this, because we make all warnings fatal when running tests. --- novaboot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/novaboot b/novaboot index 0e88881..b390d07 100755 --- a/novaboot +++ b/novaboot @@ -17,7 +17,9 @@ use strict; use warnings; -use warnings (exists $ENV{NOVABOOT_TEST} ? (FATAL => 'all') : ()); +use warnings (exists $ENV{NOVABOOT_TEST} ? + (FATAL => 'all') : + (FATAL => qw(inplace))); # Open warnings in <<>> are fatal use Getopt::Long qw(GetOptionsFromString GetOptionsFromArray); use Pod::Usage; use File::Basename; -- 2.39.2