commit a2fbe2c8dd5c417d58a75d814c560b2b8664cd00
Author: spesk1 <spesk@pm.me>
Date: Sun Jun 16 23:06:05 2019 -0400
Quick script to change gitlab paths to my new server
diff --git a/findGitlab.pl b/findGitlab.pl
index 560450a..58742cb 100755
--- a/findGitlab.pl
+++ b/findGitlab.pl
@@ -3,15 +3,26 @@
use strict;
use warnings;
+my $pwd = `echo \$PWD`;
+chomp $pwd;
+print "PWD is: $pwd\n";
+
sub find_origin {
my $path = shift;
my $configFile = $path . "config";
if ( -f $configFile ) {
my $origin = `cat $configFile | grep url | awk {'print \$3}'`;
chomp $origin;
+ my $replaceSite = "spwbk.site:";
if ( $origin =~ m/@(.*)\:/ ) {
if ( $1 ne "spwbk.site" ) {
print "$path has origin: $origin that does not match spwbk.site\n";
+ print "cd'ing into $path...\n";
+ my $replaceCmd = "sed -i s?$1:spesk1/?$replaceSite?g $configFile";
+ print "Using sed to replace $1 with spwbk.site -> $replaceCmd\n";
+ my $output = `$replaceCmd`;
+ chomp $output;
+ print "Output was: $output\n";
}
}
}