addon-jupyterlab/jupyterlab/rootfs/etc/cont-init.d/20-notebooks-dir.sh
2018-12-04 16:49:56 +01:00

27 lines
1.1 KiB
Bash

#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: JupyterLab Lite
# Ensures the JupyterLab notebooks directory exists
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
if ! hass.directory_exists '/config/notebooks'; then
mkdir -p /config/notebooks \
|| hass.die 'Failed creating notebooks directory'
git clone -b master --single-branch \
https://github.com/home-assistant/home-assistant-notebooks.git \
/config/notebooks/home-assistant \
|| hass.die 'Failed installing Home Assistant example notebooks'
git clone -b master --single-branch --depth 1 \
https://github.com/bokeh/bokeh-notebooks.git \
/config/notebooks/bokeh-examples \
|| hass.die 'Failed installing Bokeh example notebooks'
git clone -b master --single-branch --depth 1 \
https://bitbucket.org/hrojas/learn-pandas.git \
/config/notebooks/learn-pandas \
|| hass.die 'Failed installing learn pandas notebooks'
fi