diff --git a/generate.bash b/generate.bash index 0391903..0dfb19a 100755 --- a/generate.bash +++ b/generate.bash @@ -15,7 +15,7 @@ cd temp #We loop over all projects several times, each stage of the generation. #Instead of doing one project fully at a time, creating one giant nested loop. #Administration first, the processing! -PROJECTS=(laborejo patroneo vico fluajho agordejo) #The order here is the order on the page. Each of these gets its own entry. +PROJECTS=(laborejo patroneo agordejo fluajho vico) #The order here is the order on the page. Each of these gets its own entry. PROJECTS_AS_STRING=$( IFS=$' '; echo "${PROJECTS[*]}" ) @@ -25,48 +25,48 @@ do GIT="https://git.laborejo.org/lss/$PROJECT.git" echo "$GIT" - if [ -d "$PROJECT" ]; then + if [ -d "$PROJECT" ]; then cd "$PROJECT" git pull - cd .. - else - git clone "$GIT" + cd .. + else + git clone "$GIT" fi done cd "$ROOTPATH" #reset for next step #Documentation, just a copy -for PROJECT in ${PROJECTS[*]} +for PROJECT in ${PROJECTS[*]} do cp -r "temp/$PROJECT/documentation/out" "out/documentation/$PROJECT" cp "static/images/$PROJECT.png" "out/documentation/$PROJECT/logo.png" done #Generate Menu. n^2 loop. For each project all projects -for PROJECT in ${PROJECTS[*]} +for PROJECT in ${PROJECTS[*]} do echo "" > "temp/$PROJECT/module_menu" #empty file #Index/Home is the same for all sub-pages. index is not included in the list so we do not care about the "this is the current page" highlight here. - echo "
  • Home
  • " >> "temp/$PROJECT/module_menu" #automatic newline - - for EACH in ${PROJECTS[*]} + echo "
  • Home
  • " >> "temp/$PROJECT/module_menu" #automatic newline + + for EACH in ${PROJECTS[*]} do TITLE=$(echo "$EACH" | sed 's/[^ ]\+/\L\u&/g') if [ "$PROJECT" = "$EACH" ]; then - #Special line for ourselves - echo "" >> "temp/$PROJECT/module_menu" #automatic newline + #Special line for ourselves + echo "" >> "temp/$PROJECT/module_menu" #automatic newline else - echo "
  • $TITLE
  • " >> "temp/$PROJECT/module_menu" #automatic newline - fi - - done + echo "
  • $TITLE
  • " >> "temp/$PROJECT/module_menu" #automatic newline + fi + + done done -for PROJECT in ${PROJECTS[*]} +for PROJECT in ${PROJECTS[*]} do - echo "" > "temp/$PROJECT/module_page" #empty file - + echo "" > "temp/$PROJECT/module_page" #empty file + done cd "$ROOTPATH" #reset for next step @@ -83,7 +83,7 @@ done #A bit of redundancy first. Generate a menu. echo "" > "temp/index_menu" #empty file echo "" >> "temp/index_menu" #automatic newline -for EACH in ${PROJECTS[*]} +for EACH in ${PROJECTS[*]} do TITLE=$(echo "$EACH" | sed 's/[^ ]\+/\L\u&/g') echo "
  • $TITLE
  • " >> "temp/index_menu" #automatic newline @@ -95,8 +95,8 @@ cat "modules/10head" "temp/index_menu" "modules/20aftermenu" "temp/index" "modul #Check if we have an HTML dir, then deploy cd "$ROOTPATH" #reset for next step -if [ -d "../html" ]; then - echo "It looks like we are on a host. Deploying website" +if [ -d "../html" ]; then + echo "It looks like we are on a host. Deploying website" cp -r out/. ../html #copy all, including hidden. This will not replace the html symlink . Do NOT use cp -a, this will screw up file permissions fi