Return to repo list

remgit-scripts

A collection of scripts for use with a simple remote git service.
Return to HMagellan.com

commit 3458b4300c84b41c06ac719a501a0f638fffc319
parent d0e6e7e5397f7e0d60c707b8dc0aac895730dfd3
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sun,  5 Jul 2020 23:28:54 -0500

truncate some sed coms and added variable index title

Diffstat:
Mupstagit.sh | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/upstagit.sh b/upstagit.sh @@ -18,6 +18,7 @@ ICON_WIDTH="32" ICON_HEIGHT="32" STAGIT_COM="/usr/local/bin/stagit" STAGIT_INDEX_COM="$STAGIT_COM-index" +INDEX_TITLE="Repositories" WEB_USER="root" #Who should own the webroot and the files therein? # Update web frontend for each repo @@ -25,8 +26,7 @@ for i in $(ls $REPO_PATH); do # Format away the '.git' at the end of the repo name, if it is there old_i=$i i=$(sed 's,\.git$,,' <<< $i) - if [[ -d $WEB_PATH/$WEB_REPO_DIR/$i ]] - then + if [[ -d $WEB_PATH/$WEB_REPO_DIR/$i ]]; then cd $WEB_PATH/$WEB_REPO_DIR/$i rm -rd * else @@ -41,12 +41,11 @@ cd $WEB_PATH $STAGIT_INDEX_COM $REPO_PATH/* > $WEB_PATH/index.html # Update paths to stylesheets and logos in all web pages -sed -i "s,class\=\"desc\">Repositories,class\=\"desc\"><h1>Repositories<\/h1>,g" "$WEB_PATH/index.html" -sed -i "s,<td><b>Owner<\/b><\/td>,<td><\/td>,g" "$WEB_PATH/index.html" +sed -i "s,class\=\"desc\">Repositories,class\=\"desc\"><h1>$INDEX_TITLE<\/h1>,g" "$WEB_PATH/index.html" sed -i "s,<td><a href\=\",<td><a href=\"$WEB_REPO_DIR\/,g" "$WEB_PATH/index.html" -sed -i "s,src\=\".*logo\.png\",src\=\"$LOGO_URL\",g" "$WEB_PATH/index.html" +sed -i "s,<td><b>Owner<\/b><\/td>,<td><\/td>,g" "$WEB_PATH/index.html" sed -i "s,href\=\".*style\.css\",href\=\"$STYLE_URL\",g" "$WEB_PATH/index.html" -sed -i "s,width\=\"32\" height\=\"32\",width\=\"$ICON_WIDTH\" height\=\"$ICON_HEIGHT\",g" "$WEB_PATH/index.html" +sed -i "s,<img src\=\".* \/>,<img src\=\"$LOGO_URL\" alt\=\"$LOGO_ALT\" width\=\"$ICON_WIDTH\" height\=\"$ICON_HEIGHT\" \/>,g" "$WEB_PATH/index.html" sed -i "s,<table>,<table id\=\"title-head\">," "$WEB_PATH/index.html" sed -i "s,<\/span><\/td><\/tr>,<\/span><\/td><td><a href\=\"$HOME_PAGE_URL\">$HOME_LINK_TEXT<\/a><\/td><\/tr>," "$WEB_PATH/index.html"