From a1139140e0257dba51ec2f855c0376df482b3e88 Mon Sep 17 00:00:00 2001
From: Uwe Schmitt <uwe.schmitt@id.ethz.ch>
Date: Wed, 25 Aug 2021 14:52:36 +0200
Subject: [PATCH] added update_course_repo.sh script

---
 ...en_this_file_to_see_the_presentation.html} |  0
 update_course_repo.sh                         | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+)
 rename intro_presentation/{index.html => open_this_file_to_see_the_presentation.html} (100%)
 create mode 100755 update_course_repo.sh

diff --git a/intro_presentation/index.html b/intro_presentation/open_this_file_to_see_the_presentation.html
similarity index 100%
rename from intro_presentation/index.html
rename to intro_presentation/open_this_file_to_see_the_presentation.html
diff --git a/update_course_repo.sh b/update_course_repo.sh
new file mode 100755
index 0000000..f642352
--- /dev/null
+++ b/update_course_repo.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+# update_course_repo.sh
+# Copyright (C) 2021 Uwe Schmitt <uwe.schmitt@id.ethz.ch>
+#
+# Distributed under terms of the MIT license.
+#
+
+set -e
+
+NOTEBOOKS=??_*.ipynb
+NEEDED="images data"
+EXTRA="Install.md LICENSE intro_presentation environment.yml"
+
+REPOURL=https://gitlab.ethz.ch/sis/machine-learning-workshop
+
+echo
+echo This script will upload the following files and folders to ${REPOURL}:
+echo
+for P in ${NEEDED} ${EXTRA} ${NOTEBOOKS}; do
+    echo "   " ${P}
+done
+echo
+echo you might be prompted to enter your NETHZ account name and password
+echo
+
+while true; do
+    read -p "Do you wish to continue?" yn
+    case $yn in
+        [Yy]* ) break;;
+        [Nn]* ) exit;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done
+
+
+FLDR=$(mktemp -d)
+git -C ${FLDR} clone ${REPOURL}.git
+
+ROOT=${FLDR}/machine-learning-workshop
+
+test -d ${ROOT}/solutions || mkdir -p ${ROOT}/solutions
+
+NOTEBOOKS=??_*.ipynb
+NEEDED="images data"
+EXTRA="Install.md LICENSE intro_presentation environment.yml"
+
+cp -R ${NEEDED} ${NOTEBOOKS} ${ROOT}/solutions
+
+cp -R ${NEEDED} ${EXTRA} ${ROOT}
+
+for N in ${NOTEBOOKS}; do
+    jupyter nbconvert ${N} \
+        --TagRemovePreprocessor.enabled=True \
+        --TagRemovePreprocessor.remove_cell_tags='{"solution"}' \
+        --to notebook \
+        --output ${ROOT}/${N}
+done
+
+git -C ${ROOT} add ${ROOT}
+git -C ${ROOT} commit -m "update"
+git -C ${ROOT} push
-- 
GitLab