Skip to content

Conversation

@plicease
Copy link
Member

No description provided.

@plicease plicease merged commit d9dd035 into main Nov 26, 2025
13 checks passed
@plicease plicease deleted the graham/replace-in-place-if-exists branch November 26, 2025 17:00
Comment on lines +166 to +174
use autodie qw( truncate close );
# re-write the perl to the file, using the existing inode
my $backup = Path::Tiny->new(File::Temp::tempnam($self->perl_filename->parent, $self->perl_filename->basename));
$self->perl_filename->copy($backup) if -f $self->perl_filename;
my $fh = $self->perl_filename->openrw_utf8;
truncate $fh, 0;
print $fh $perl or die "unable to write to @{[ $self->perl_filename ]} $!";
close $fh;
$backup->remove if -f $backup;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man, this is the kind of stuff I relied on Path::Tiny to hide from me!!!! 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants