Browse Source

initial commit

spesk1 4 years ago
commit
3892d31a40
1 changed files with 33 additions and 0 deletions
  1. 33 0
      findGitlab.pl

+ 33 - 0
findGitlab.pl

@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+sub find_origin {
+	my $path = shift;
+	my $configFile = $path . "config";
+	if ( -f $configFile ) {
+		my $origin = `cat $configFile  | grep url | awk {'print \$3}'`;
+		chomp $origin;
+		if ( $origin =~ m/@(.*)\:/ ) {
+			if ( $1 ne "spwbk.site" ) {
+				print "$path has origin: $origin that does not match spwbk.site\n";
+			}
+		}
+	}
+}
+
+sub find_git {
+	my $path = shift;
+	my $gitDirPath = $path . ".git/";
+	if ( -d $gitDirPath ) {
+		find_origin($gitDirPath);
+
+	}
+}
+
+
+foreach my $dir ( split("\n",`ls -d */`) ) {
+	chomp $dir;
+	find_git($dir);
+}