@@ -763,13 +763,9 @@ sub load_rexfile {
763
763
for (@warnings ) {
764
764
chomp ;
765
765
766
- # remove /loader/.../ prefix before filename
767
- s { /loader/[^/]+/} {} sxm ;
766
+ my $message = _tidy_loading_message( $_ , $rexfile );
768
767
769
- # convert Rexfile to human-friendly name
770
- s { __Rexfile__.pm} { Rexfile} msx ;
771
-
772
- Rex::Logger::info( " \t $_ " , ' warn' );
768
+ Rex::Logger::info( " \t $message " , ' warn' );
773
769
}
774
770
}
775
771
@@ -780,12 +776,7 @@ sub load_rexfile {
780
776
my $e = $@ ;
781
777
chomp $e ;
782
778
783
- # remove the strange path to the Rexfile which exists because
784
- # we load the Rexfile via our custom code block.
785
- $e =~ s | /loader/[^/]+/|| smg ;
786
-
787
- # convert Rexfile to human-friendly name
788
- $e =~ s { __Rexfile__.pm} { Rexfile} msx ;
779
+ $e = _tidy_loading_message( $e , $rexfile );
789
780
790
781
my @lines = split ( $/ , $e );
791
782
@@ -796,6 +787,13 @@ sub load_rexfile {
796
787
}
797
788
}
798
789
790
+ sub _tidy_loading_message {
791
+ my ( $message , $rexfile ) = @_ ;
792
+
793
+ $message =~ s { /loader/[^/]+/__Rexfile__[.]pm} { $rexfile } gmsx ;
794
+ return $message ;
795
+ }
796
+
799
797
sub exit_rex {
800
798
my ( $exit_code_override , $signal ) = @_ ;
801
799
0 commit comments