diff --git a/lib/npg_tracking/illumina/run/folder.pm b/lib/npg_tracking/illumina/run/folder.pm index 7959470e..01654f0b 100644 --- a/lib/npg_tracking/illumina/run/folder.pm +++ b/lib/npg_tracking/illumina/run/folder.pm @@ -404,13 +404,9 @@ sub _get_path_from_given_path { my @dirs = splitdir($subpath); while (@dirs) { my $path = catdir(@dirs); - if ( -d $path - and - -d catdir($path, $CONFIG_DIR) # does this directory have a Config Directory - and - -d catdir($path, $DATA_DIR) # a runfolder is likely to have a Data directory - ) { - return $path; + # a runfolder has to have a Data directory + if (-d $path and -d catdir($path, $DATA_DIR)) { + return $path; } pop @dirs; } diff --git a/t/60-illumina-run-folder.t b/t/60-illumina-run-folder.t index 99b8b035..918bd2ef 100644 --- a/t/60-illumina-run-folder.t +++ b/t/60-illumina-run-folder.t @@ -188,7 +188,6 @@ subtest 'standard runfolder, no DB access' => sub { $paths->{no_archive_subpath} = $paths->{bbcalls_subpath} . q{/no_archive}; $paths->{pp_archive_subpath} = $paths->{bbcalls_subpath} . q{/pp_archive}; $paths->{qc_subpath} = $paths->{archive_subpath} . q{/qc}; - $paths->{config_path} = $runfolder_path . q{/Config}; for my $path (values %{$paths}) { make_path($path);