diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-07 20:49:26 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-07 20:49:26 +0200 |
commit | c546fee3fa3f3f1430bd289c51fc6a9e1a1030bf (patch) | |
tree | 5cf3e5c2396ef327383fba372cedfccf7bb5d98f /update-gitjoe.pl | |
parent | test (diff) | |
download | joe-scripts-c546fee3fa3f3f1430bd289c51fc6a9e1a1030bf.tar.gz joe-scripts-c546fee3fa3f3f1430bd289c51fc6a9e1a1030bf.tar.bz2 joe-scripts-c546fee3fa3f3f1430bd289c51fc6a9e1a1030bf.tar.xz joe-scripts-c546fee3fa3f3f1430bd289c51fc6a9e1a1030bf.tar.zst joe-scripts-c546fee3fa3f3f1430bd289c51fc6a9e1a1030bf.zip |
Better dir
Diffstat (limited to 'update-gitjoe.pl')
-rwxr-xr-x | update-gitjoe.pl | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/update-gitjoe.pl b/update-gitjoe.pl deleted file mode 100755 index 6a10b5e..0000000 --- a/update-gitjoe.pl +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use warnings; -use Term::ANSIColor; - -sub get_repos_index { - my $user = $_[0]; - my $homedir = '/usr/home/' . $user . '/'; - opendir(DIR, $homedir); - my @repos; - my $i = 0; - while (my $dir = readdir(DIR)) { - next if ($dir =~ m/^\./); - next if (!(-e $homedir . $dir . '/git-daemon-export-ok')); - $repos[$i] = $dir; - $i += 1; - } - $i = 0; - print 'User - ' . colored($user, 'bold') . " - repositories: \n"; - while ($i < @repos) { - print $repos[$i] . "\n"; - $i += 1; - } - closedir(DIR); - print "\n"; - return @repos; -} - -sub stagit_generate { - my ($user, @repos) = @_; - my $i = 0; - while ($i < @repos) { - print colored($repos[$i], 'bold red') . "\n"; - $i += 1; - } - return; -} - -sub main { - my $homedir = '/usr/home/'; - my @users; - opendir(DIR, $homedir); - my $i = 0; - while (my $dir = readdir(DIR)) { - next if ($dir eq 'git-ro'); - next if ($dir =~ m/^\./); - $users[$i] = $dir; - $i += 1; - } - closedir(DIR); - $i = 0; - while ($i < @users) { - my @repos = get_repos_index($users[$i]); - stagit_generate($users[$i], @repos); - $i += 1; - } - exit; -} - -main(); - -__END__ |