App-FuguBench
view release on metacpan or search on metacpan
lib/App/FuguBench/Worktree.pm view on Meta::CPAN
# A project can leave a symbolic link at the destination, and
# the copy must not write through it. A regular file that
# exists stays, so a second run keeps a local change
# (WT-CLONE-4).
unlink $dst if -l $dst;
if ( -e $dst ) {
$log->notice( 'already exists, skipped: %s', $dst );
return 1;
}
# A .env file holds credentials, so the copy takes the mode of
# the source and not the default of the umask. The stat runs
# before the copy: a stat after it can follow a parallel
# removal of the source, and the chmod then gives the copy the
# mode 0.
my @stat = stat $src;
unless ( File::Copy::copy( $src, $dst ) ) {
$log->error( 'cannot copy %s -> %s: %s', $src, $dst, $! );
return 0;
}
if ( @stat && chmod( $stat[2] & 07777, $dst ) != 1 ) {
lib/App/FuguBench/Worktree.pod view on Meta::CPAN
link is content of the repository, and it stays there.
A destination that exists stays as it is, so a second run repairs a
bootstrap that stopped early and keeps a local change. A symbolic
link at the destination of a file copy goes first, and a regular file
takes its place, so the copy writes no byte through the link.
The subcommand writes inside the current directory only. In the main
checkout itself it reports that fact and changes nothing. It writes
no credential into a settings file: a F<.env> file is a file copy,
and the HOME profiles hold the credentials.
=head1 EXIT CODES
The verb returns the exit codes of L<Fugu::CLI>. A subcommand that
does its work returns 0.
It returns 1 after a failure: a root that is no main checkout, a name
of the wrong shape, a nest, a path that is no worktree of the name, a
step that fails, or a signal. C<remove> returns 1 after a refusal,
after a path that resolves outside the base, and after a directory or
( run in 1.587 second using v1.01-cache-2.11-cpan-007c89162af )