From 06a69668c64ca72c44097dda0b9a10b633e87986 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 7 Jul 2020 21:07:54 +0200 Subject: Test with that --- src/update-gitjoe.pl | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3