From ff3fcfcd8440142383843a4863c758b591c1eea6 Mon Sep 17 00:00:00 2001 From: bolkun <bolkun@BDV092.slub-dresden.de> Date: Fri, 15 Nov 2019 11:24:44 +0100 Subject: [PATCH] Bug Fix beim Ordner bzw. Test Dateien Erstellung --- t/slubsipbuilder.t | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/t/slubsipbuilder.t b/t/slubsipbuilder.t index ced09ce..6c55499 100755 --- a/t/slubsipbuilder.t +++ b/t/slubsipbuilder.t @@ -549,23 +549,18 @@ my $valid_ie_dir_path = $export_dir_kitodo_path->absolute . "/" . $valid_ie_dir; my $not_valid_ie_dir_path = $export_dir_kitodo_path->absolute . "/" . $not_valid_ie_dir; my $file = "test.txt"; my $file2 = "test+.txt"; -if(! -d $export_dir_kitodo_path) { - mkdir $export_dir_kitodo_path or die "Error creating directory: $export_dir_kitodo_path"; - if(! -d $export_dir_kitodo_path->child($valid_ie_dir)) { - mkdir $export_dir_kitodo_path->child($valid_ie_dir) or die "Error creating directory: $export_dir_kitodo_path->child($valid_ie_dir)"; - if(! -f $export_dir_kitodo_path->child($valid_ie_dir)->child($file)) { - open FILE, '>'.$export_dir_kitodo_path->child($valid_ie_dir)->child($file) or die "Unable to create $file"; - close FILE; - } - } - if(! -d $export_dir_kitodo_path->child($not_valid_ie_dir)) { - mkdir $export_dir_kitodo_path->child($not_valid_ie_dir) or die "Error creating directory: $export_dir_kitodo_path->child($not_valid_ie_dir)"; - if(! -f $export_dir_kitodo_path->child($not_valid_ie_dir)->child($file2)) { - open FILE, '>'.$export_dir_kitodo_path->child($not_valid_ie_dir)->child($file2) or die "Unable to create $file"; - close FILE; - } - } +if(! -d $export_dir_kitodo_path) { mkdir $export_dir_kitodo_path or die "Error creating directory: $export_dir_kitodo_path"; } +if(! -d $export_dir_kitodo_path->child($valid_ie_dir)) { mkdir $export_dir_kitodo_path->child($valid_ie_dir) or die "Error creating directory: $export_dir_kitodo_path->child($valid_ie_dir)"; } +if(! -f $export_dir_kitodo_path->child($valid_ie_dir)->child($file)) { + open FILE, '>'.$export_dir_kitodo_path->child($valid_ie_dir)->child($file) or die "Unable to create $file"; + close FILE; +} +if(! -d $export_dir_kitodo_path->child($not_valid_ie_dir)) { mkdir $export_dir_kitodo_path->child($not_valid_ie_dir) or die "Error creating directory: $export_dir_kitodo_path->child($not_valid_ie_dir)"; } +if(! -f $export_dir_kitodo_path->child($not_valid_ie_dir)->child($file2)) { + open FILE, '>'.$export_dir_kitodo_path->child($not_valid_ie_dir)->child($file2) or die "Unable to create $file"; + close FILE; } + my $mysip_path = path(__FILE__)->parent->parent->child('tmp')->child('mysip'); if(! -d $mysip_path->parent) { mkdir $mysip_path->parent or die "Error creating directory: tmp";} if(! -d $mysip_path) { mkdir $mysip_path or die "Error creating directory: $mysip_path";} -- GitLab