From 1cf4611946b418b49a071b78d7f5da3649483a8d Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 9 Jul 2020 17:34:01 +0200 Subject: Added fine end script messages --- src/gitjoe/newrepo.pl | 4 ++++ src/gitjoe/rmrepo.pl | 1 + src/gitjoe/rmuser.pl | 1 + src/update/gitjoe.pl | 18 +++++++----------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gitjoe/newrepo.pl b/src/gitjoe/newrepo.pl index 951b1b5..d0e6bff 100755 --- a/src/gitjoe/newrepo.pl +++ b/src/gitjoe/newrepo.pl @@ -87,6 +87,10 @@ sub main { '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'description' ); } + substr($repo, -1) = ""; + print "Created git repository " . colored($repo, 'bold green') . " . for user " . colored($usr, 'bold') . ".\n"; + print "Remote url: " . colored($usr . '@jozanleclerc.xyz:' . $repo, 'bold green') . "\n" + . "Public clone url: " . colored('git://jozanleclerc.xyz/' . $usr . '/' . $repo, 'bold green') . "\n"; exit; } diff --git a/src/gitjoe/rmrepo.pl b/src/gitjoe/rmrepo.pl index 30ce4d2..632c6f7 100755 --- a/src/gitjoe/rmrepo.pl +++ b/src/gitjoe/rmrepo.pl @@ -25,6 +25,7 @@ sub main { '-c', '/bin/rm -rfv ' . $home_dir . $repo ); + print "Deleted git repository " . colored($repo, 'bold yellow') . " for user " . colored($usr, 'bold') . ".\n"; exit; } diff --git a/src/gitjoe/rmuser.pl b/src/gitjoe/rmuser.pl index 944745f..d9b056d 100755 --- a/src/gitjoe/rmuser.pl +++ b/src/gitjoe/rmuser.pl @@ -23,6 +23,7 @@ y y EOF" ); + print "Removed git user " . colored($usr, 'bold yellow') . ".\n"; exit; } diff --git a/src/update/gitjoe.pl b/src/update/gitjoe.pl index a0f4e59..b2d9269 100755 --- a/src/update/gitjoe.pl +++ b/src/update/gitjoe.pl @@ -27,14 +27,12 @@ sub stagit_generate { my $site_dir = '/usr/local/www/git-jozan/'; my $home_dir = '/usr/home/' . $user . '/'; chdir($site_dir); - # system( - # '/usr/local/bin/dash', - # '-c', - # '/bin/rm -rf ' . $user . '/' - # ); - if (!(-e $user . '/')) { - mkdir($user . '/', 0755); - } + system( + '/usr/local/bin/dash', + '-c', + '/bin/rm -rf ' . $user . '/' + ); + mkdir($user . '/', 0755); my $i = 0; my $repos_line = ""; copy('./css/gitjoe.css', './' . $user . '/style.css'); @@ -43,9 +41,7 @@ sub stagit_generate { chdir($site_dir . $user . '/'); $repos_line = $repos_line . ' ' . $home_dir . $repos[$i] . '/'; substr($repos[$i], -4) = ""; - if (!(-e $repos[$i] . '/')) { - mkdir($repos[$i] . '/', 0755); - } + mkdir($repos[$i] . '/', 0755); chdir($site_dir . $user . '/' . $repos[$i] . '/'); $repos[$i] = $repos[$i] . '.git'; print "Indexing " . $user . '/' . $repos[$i] . ".\n"; -- cgit v1.2.3