summaryrefslogtreecommitdiff
path: root/bin/src-register-all
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-08-09 15:43:12 +0100
committerSean Whitton <spwhitton@spwhitton.name>2019-08-09 15:43:12 +0100
commitd9efc808c1e0dd933bc14609b32bc838c0cf21a9 (patch)
tree31da67a240108ec8f4de11e4f4a038bd575b261a /bin/src-register-all
parent3d45ab77cba4cfbc830eddc741b4a32998e3d309 (diff)
downloaddotfiles-d9efc808c1e0dd933bc14609b32bc838c0cf21a9.tar.gz
tweaks/fixes to src-register-all
Diffstat (limited to 'bin/src-register-all')
-rwxr-xr-xbin/src-register-all14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/src-register-all b/bin/src-register-all
index 541f196d..5736ccd6 100755
--- a/bin/src-register-all
+++ b/bin/src-register-all
@@ -19,7 +19,9 @@
-# This script must be as portable as possible (inc. its shebang).
+# This script must be as portable as possible (inc. its shebang). We
+# do assume that the path separator is a forward slash, rather than
+# using catfile(), because .mrconfig assumes that too
use strict;
use warnings;
@@ -32,7 +34,7 @@ my @known_repos;
open my $fh, "<", ".mrconfig";
while (<$fh>) {
if (/^\[(src\/.+)\]$/) {
- push @known_repos, getcwd()."/$1";
+ push @known_repos, $ENV{HOME}."/$1";
}
}
find({wanted => \&register, preprocess => \&skip}, "src");
@@ -46,7 +48,7 @@ sub skip {
foreach my $entry (@_) {
my $entry_path = $cwd."/$entry";
push @entries, $entry
- unless grep /\A$entry_path\z/, @known_repos;;
+ unless grep /\A$entry_path\z/, @known_repos;
}
return @entries;
}
@@ -55,9 +57,9 @@ sub register {
chdir $_;
my $register_out = `mr -c $ENV{HOME}/.mrconfig register 2>&1`;
unless ($? == 0) {
- print "mr register: $File::Find::name\n";
- print $register_out;
- die "\n";
+ print STDERR "mr register: $File::Find::name\n";
+ print STDERR $register_out."\n";
+ exit 1;
}
chdir "..";
}