replace build.just with compile.pl
This commit is contained in:
@ -49,6 +49,29 @@ sub date_now {
|
||||
return $date;
|
||||
}
|
||||
|
||||
sub run {
|
||||
my @cmd = @_;
|
||||
say " + @cmd";
|
||||
system(@cmd) == 0
|
||||
or die "Command failed (exit " . ( $? >> 8 ) . "): @cmd\n";
|
||||
}
|
||||
|
||||
sub read_file {
|
||||
my ($file) = @_;
|
||||
open( my $readhandle, '<', $file ) or die "failed to open $file: $!";
|
||||
local $/;
|
||||
my $content = <$readhandle> // die "failed to read $file: $!";
|
||||
close($readhandle) or die "failed to close $file: $!";
|
||||
return $content;
|
||||
}
|
||||
|
||||
sub write_file {
|
||||
my ( $file, $content ) = @_;
|
||||
open( my $writehandle, '>', $file ) or die "failed to open $file: $!";
|
||||
print $writehandle $content or die "failed to write $file: $!";
|
||||
close($writehandle) or die "failed to close $file: $!";
|
||||
}
|
||||
|
||||
sub rewrite_file {
|
||||
my ( $file, $matches, $replacement ) = @_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user