look for #! to determine if the file is PYTHON or PYTHON-BIN

(cherry picked from commit 4fcc550877)
This commit is contained in:
Mark Andrews 2018-02-05 11:31:36 +11:00
parent 5c36169128
commit b480d1eaa8

View file

@ -69,6 +69,11 @@ while (<CHANGES>) {
$file_types{$_} = "PERL";
} elsif ($base =~ /\.py$/i) {
$file_types{$_} = "PYTHON";
if (open(PYTHON, $_)) {
my $line = <PYTHON>;
$file_types{$_} = "PYTHON-BIN" if ($line && $line =~ /^#!/);
close(PYTHON);
}
} elsif ($base =~ /\.sh$/) {
$file_types{$_} = "SH";
} elsif ($base =~ /\.docbook$/ ||