forked from petdance/tidyp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtidysync
executable file
·41 lines (29 loc) · 1.09 KB
/
tidysync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl
=pod
This is not meant for human consumption. It's for Andy to sync up the
libtidy CVS directory with the github libtidy copy of it.
This expects that you have tidy checked out like so, in a parallel directory:
cvs -d:pserver:[email protected]:/cvsroot/tidy login
cvs -z3 -d:pserver:[email protected]:/cvsroot/tidy co -P modulename
=cut
use warnings;
use strict;
use File::Copy;
use File::Find;
use Perl6::Say;
# This finagling assumes we're in html-tidy, and there's a ../tidy
my @skipdirs = qw( CVS CVSROOT experimental test bin lib obj );
my %skipdirs = map {($_,1)} @skipdirs;
my $sourcedir = '../tidy';
find( sub {
if ( -d ) {
$File::Find::prune = 1 if $skipdirs{$_};
return;
}
my $name = $File::Find::name;
$name =~ s{^\Q$sourcedir/}{} or die 'Bad filenaming going on';
my $source = "$sourcedir/$name";
my $target = "libtidy/$name";
say "cp -p $source $target";
#copy( $source, $target ) or die "Can't copy $source to $target: $!";
}, $sourcedir );