diff --git a/Makefile b/Makefile index 2e9b1e1..db09b81 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +VERBOSE=false +export VERBOSE unpushed=$(shell git log --pretty=format:'%h' @{u}.. | wc -c) all: lime2test cours procedures cv index diff --git a/bin/create-index.sh b/bin/create-index.sh index 0f83e56..cc240b4 100755 --- a/bin/create-index.sh +++ b/bin/create-index.sh @@ -4,7 +4,9 @@ [ "$HOSTNAME" != lime2 ] || exit 1 -echo "Updating index.html" +if [ "$VERBOSE" = true ]; then + echo "Updating index.html" +fi chmod 644 ./index.html diff --git a/bin/pull-cours.sh b/bin/pull-cours.sh index 450b36e..5e8c2f9 100755 --- a/bin/pull-cours.sh +++ b/bin/pull-cours.sh @@ -4,13 +4,17 @@ [ "$HOSTNAME" != lime2 ] || exit 1 -echo -n "Pulling cours... " +if [ "$VERBOSE" = true ]; then + echo -n "Pulling cours... " +fi origin_file_time=$(stat -c %Y ~/tssr/cours/cours*.pdf) current_file_time=$(stat -c %Y ./cours.pdf) if [ "$origin_file_time" -gt "$current_file_time" ]; then - cp ~/tssr/cours/cours*.pdf ./cours.pdf && echo "Done" + cp ~/tssr/cours/cours*.pdf ./cours.pdf && echo "Updated cours" else - echo "Already up to date" + if [ "$VERBOSE" = true ]; then + echo "Already up to date" + fi fi diff --git a/bin/pull-cv.sh b/bin/pull-cv.sh index 86fd576..927a9c8 100755 --- a/bin/pull-cv.sh +++ b/bin/pull-cv.sh @@ -4,10 +4,14 @@ [ "$HOSTNAME" != lime2 ] || exit 1 -echo -n "Pulling CV... " +if [ "$VERBOSE" = true ]; then + echo -n "Pulling CV... " +fi cp ~/src/html-cv/out.html ./cv/index.html cp ~/src/html-cv/data/cv-photo ./cv/data/cv-photo cp -r ~/src/html-cv/css ./cv -echo "Done" +if [ "$VERBOSE" = true ]; then + echo "Done" +fi diff --git a/bin/pull-procedures.sh b/bin/pull-procedures.sh index aadab29..c6b4964 100755 --- a/bin/pull-procedures.sh +++ b/bin/pull-procedures.sh @@ -12,17 +12,23 @@ for folder in ~/tssr/procedures/*; do name=$(basename "$folder") display_name=$(echo "$name" | sed -E 's/procedure_//g; s/_202.+//g; s/-/ /g; s/_/ /g') if [[ "$name" = *chose* ]]; then # ignore procedure_chose - echo "Ignoring ${name}" + if [ "$VERBOSE" = true ]; then + echo "Ignoring ${name}" + fi else - echo -n "Pulling ${name}..." + if [ "$VERBOSE" = true ]; then + echo -n "Pulling ${name}..." + fi if [[ ! "$name" = *tablette* ]]; then origin_file_time=$(stat -c %Y "$folder"/procedure*.pdf) current_file_time=$(stat -c %Y ./procedures/procedure_"$name".pdf) fi if [ -z "$current_file_time" ] || [ "$origin_file_time" -gt "$current_file_time" ]; then - cp "$folder"/procedure*.pdf ./procedures/procedure_"$name".pdf + cp "$folder"/procedure*.pdf ./procedures/procedure_"$name".pdf && echo "Updated $name" else - echo "Already up to date" + if [ "$VERBOSE" = true ]; then + echo "Already up to date" + fi fi sed -i "s@===PROCEDURE===@
  • ${display_name}

  • \n===PROCEDURE===@g" ./procedures/index.tmp.html fi @@ -31,6 +37,6 @@ done chmod 644 ./procedures/index.html -sed 's/===PROCEDURE===//g' ./procedures/index.tmp.html > ./procedures/index.html && rm ./procedures/index.tmp.html && echo "Done" +sed 's/===PROCEDURE===//g' ./procedures/index.tmp.html > ./procedures/index.html && rm ./procedures/index.tmp.html chmod 444 ./procedures/index.html