Commit d1040524 authored by Robert Goldman's avatar Robert Goldman

Fix bump-version to use vanilla perl.

Seems like some perl installs will have File::Slurp and some will have
File::Slurper.  Instead we just use vanilla perl for write_text and
read_text.
parent 32eef692
#! /usr/bin/env perl #! /usr/bin/env perl
use FindBin; use FindBin;
use File::Slurper qw(read_text write_text);
use Getopt::Long; use Getopt::Long;
our $old; our $old;
our $new; our $new;
...@@ -76,3 +75,24 @@ sub transform_files { ...@@ -76,3 +75,24 @@ sub transform_files {
} }
} }
# can't reliably find File::Slurper, or File::Slurp, so do it
# old school.
sub read_text ($) {
my $fn = shift;
local $/ = undef;
open READFILE, $fn or die "Couldn't open file: $fn";
binmode READFILE;
my $string = <READFILE>;
close READFILE;
return $string;
}
sub write_text ($$) {
my $fn = shift;
my $data = shift;
open WRITEFILE, "> $fn" or die "Couldn't open $fn for writing.";
print WRITEFILE $data;
close WRITEFILE;
return 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment