lint:
- perl ./tools/lint-dotfiles.pl
+ perl ./tools/list-files.pl | perl ./tools/find-missing.pl
.PHONY: lint
\ No newline at end of file
--- /dev/null
+use strict;
+use warnings;
+use Smart::Comments;
+
+sub main {
+ while (defined(my $rel = <>)) {
+ chomp $rel;
+ my $saved = rel2saved($rel);
+
+ if (!-e $saved) {
+ print "? $rel\n";
+ }
+ }
+}
+
+sub rel2saved {
+ my $rel = shift;
+
+ $rel =~ tr/./_/;
+ return "./dot-files/$rel";
+}
+
+main();
map {tr/\n//d; $_}
<DATA>;
-my @CURRENT = find($ENV{HOME}, '.', sub {$_[0] =~ m/^\./});
+main();
+
+sub main {
+ my @current = find($ENV{HOME}, '.', sub {$_[0] =~ m/^\./});
+
+ foreach (@current) {
+ print "$_\n";
+ }
+}
sub find {
my $base = shift;
my $rel = File::Spec->abs2rel($abs, $base);
next if any { $rel =~ m/$_/ } @RE_IGNORED;
+ next if !-f $abs;
if (-d $abs) {
push @d, find($base, $rel);
@d;
}
-foreach my $file (@CURRENT) {
- # Is it in the repository?
- if (-e $file) {
-
- }
- else {
- print "? $file\n";
- }
-}
-
__DATA__
*~
.*cache*