diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-12 18:05:33 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-12 18:05:33 +0200 |
commit | 49ddbef55a9e5d561222b36ed5866ff9c722a44a (patch) | |
tree | b4c62bf9b054ca0545c83b02e5d304dc741a12ec | |
parent | ef7899f01c6c20b7d18e1b668459a632a989f0b7 (diff) | |
download | xutil-49ddbef55a9e5d561222b36ed5866ff9c722a44a.tar.gz |
re!: Warn if no shebang instead of dying
-rwxr-xr-x | etc/re! | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -18,7 +18,11 @@ for my $file (@ARGV) { # parse shebang my $shebang = <$o>; - $shebang =~ /^#!/ or die "no shebang: $file\n"; + if (not $shebang =~ /^#!/) { + warn "no shebang: $file\n"; + close $o; + next; + } $shebang =~ /^#!\s*(\S+)\s*(.*)/; my ($old, $args) = ($1, $2); |