1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 1;
7
8use Test::Differences qw/ eq_or_diff /;
9use Path::Tiny qw/ path /;
10use FC_Solve::Paths qw( src_file );
11
12my $data = src_file( [] )->visit(
13    sub {
14        my ( $path, $state ) = @_;
15        if ( $path->is_file and $path->basename =~ m#\.sh\z# )
16        {
17            my ($head) = $path->lines( { count => 1 } );
18            if (
19                not(   ( $head eq "#!/bin/sh\n" )
20                    || ( $head eq "#!/bin/bash\n" ) )
21                )
22            {
23                $state->{$path} = $head;
24            }
25        }
26        return;
27    },
28    { recurse => 1 },
29);
30
31# TEST
32eq_or_diff( $data, +{}, 'All .sh files have the right sha-bang' );
33