diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/update-gitjoe.pl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/update-gitjoe.pl b/src/update-gitjoe.pl index a0471ee..01f75a8 100755 --- a/src/update-gitjoe.pl +++ b/src/update-gitjoe.pl @@ -29,12 +29,37 @@ sub get_repos_index { sub stagit_generate { my ($user, @repos) = @_; - my $i = 0; my $site_dir = '/usr/local/www/git-jozan/'; + my $home_dir = '/usr/local/' . $user . '/'; chdir($site_dir); + system( + '/usr/local/bin/dash', + '-c', + '/bin/rm -rf ' . $user . '/' + ); + mkdir($user, 0755); + chdir($site_dir . $user . '/'); + my $i = 0; + my $repos_line = ""; while ($i < @repos) { + $repos_line = $repos_line . ' ' . $home_dir . $repos[$i] . '/'; + substr($repos[$i], -4) = ""; + mkdir($repos[$i], 0755); + $repos[$i] = $repos[$i] . '.git'; + chdir($site_dir . $user . '/' . $repos[$i] . '/'); + system( + '/usr/local/bin/dash', + '-c', + '/usr/local/bin/stagit ' . $home_dir . $repos[$i] . '/' + ); $i += 1; } + chdir($site_dir . $user . '/'); + system( + '/usr/local/bin/dash', + '-c', + '/usr/local/bin/stagit-index ' . $repos_line . '> index.html' + ); return; } |