Return to repo list

remgit-scripts

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

commit 0b7511f95af75757b089f0b41d7d4b604167c5a0
parent fc7ff0e9971dfa544cf2d83dd4d70711d96ae860
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sun,  5 Jul 2020 19:36:07 -0500

Fixed linking and added more vars to customize

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

diff --git a/upstagit.sh b/upstagit.sh @@ -10,7 +10,9 @@ WEB_REPO_DIR="repos" WEB_URL="https://example.com" GIT_ACCESS_URL="git://example.com" #For git protocol links HOME_PAGE_URL="https://example.com" #For making a link to a homepage besides the git index +HOME_LINK_TEXT="Return home" LOGO_URL="$WEB_URL/example.jpg" +LOGO_ALT="Alt text" #Alt text for logo image STYLE_URL="$WEB_URL/style.css" ICON_WIDTH="32" ICON_HEIGHT="32" @@ -46,15 +48,12 @@ sed -i -E -e "s,src\=\".*logo\.png\",src\=\"$LOGO_URL\",g" "$WEB_PATH/index.html sed -i -E -e "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,<table>,<table id\=\"title-head\">," "$WEB_PATH/index.html" -sed -i "s,<\/span><\/td><\/tr>,<\/span><\/td><td><a href\=\"$HOME_PAGE_URL\">Return Home<\/a><\/td><\/tr>," "$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" for j in $(ls $REPO_PATH); do for k in $(ls -R -a1 $WEB_PATH/$WEB_REPO_DIR/* | find $WEB_PATH/$WEB_REPO_DIR | grep ".html$"); do - #sed -i -E -e "s,href\=\"\.\.\/\",href\=\"$WEB_URL\",g" "$k" - sed -i -E -e "s,\=\"\(\.\.\/\)*logo\.png\",\=\"$LOGO_URL\",g" "$k" - sed -i -E -e "s,\=\"\(\.\.\/\)*style\.css\",\=\"$STYLE_URL\",g" "$k" - sed -i "s,width\=\"32\" height\=\"32\",width\=\"$ICON_WIDTH\" height=\=\"$ICON_HEIGHT\",g" "$k" - sed -i "s,<table>.*<img,<table id\=\"title-head\"><tr><td><a href\=\"$WEB_URL\"><img," "$k" + sed -i -E -e "s,css\" href\=\".*style\.css\",css\" href\=\"$STYLE_URL\"," "$k" + sed -i "s,<table>.*<img.*\/>,<table id\=\"title-head\"><tr><td><a href\=\"$WEB_URL\"><img src\=\"$LOGO_URL\" alt\=\"$LOGO_ALT\" width\=\"$ICON_WIDTH\" height\=\"$ICON_HEIGHT\" \/> ," "$k" sed -i "s,<\/a><\/td><\/tr><\/table>,<\/a> \| git clone: <a href\=\"$GIT_ACCESS_URL\/$j\">$GIT_ACCESS_URL\/$j<\/a><\/td><\/tr><\/table>," "$k" done done