File Coverage

File:cleanup-file.pl
Coverage:55.6%

linestmtbrancondsubtimecode
1#!/usr/bin/env perl
2
1
1
1
1111
1
437
use Cwd qw(abs_path);
3
1
44176
my $maybe_bad=abs_path($ENV{maybe_bad});
4
1
4
my $workspace_path=abs_path($ENV{GITHUB_WORKSPACE});
5
1
9
if ($maybe_bad !~ /^\Q$workspace_path\E/) {
6
0
0
    print "::error ::Configuration files must live within $workspace_path...\n";
7
0
0
    print "::error ::Unfortunately, file $maybe_bad appears to reside elsewhere.\n";
8
0
0
    exit 3;
9}
10
1
0
if ($maybe_bad =~ m{/\.git/}i) {
11
0
0
    print "::error ::Configuration files must not live within `.git/`...\n";
12
0
0
    print "::error ::Unfortunately, file $maybe_bad appears to.\n";
13
0
0
    exit 4;
14}