Skip to content
Snippets Groups Projects
Commit d1040524 authored by Robert Goldman's avatar Robert Goldman
Browse files

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
No related branches found
No related tags found
No related merge requests found
#! /usr/bin/env perl
use FindBin;
use File::Slurper qw(read_text write_text);
use Getopt::Long;
our $old;
our $new;
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment