aboutsummaryrefslogtreecommitdiff
path: root/collection/jupyterlab/install.sh
diff options
context:
space:
mode:
authorJosh Spicer <josh@joshspicer.com>2022-05-12 23:10:51 +0300
committerGitHub <noreply@github.com>2022-05-12 23:10:51 +0300
commit3a277ad757dbc51a43a5dd452d030c67a49d49f1 (patch)
tree7d4f27493f946d8792b2ff5b6383258cb9f03ce0 /collection/jupyterlab/install.sh
parent2707a37ca0d4a45c7487f856bf95f8c5e10bce94 (diff)
restructure and update cli (#11)
* restructure and update cli * typo
Diffstat (limited to 'collection/jupyterlab/install.sh')
-rw-r--r--collection/jupyterlab/install.sh51
1 files changed, 0 insertions, 51 deletions
diff --git a/collection/jupyterlab/install.sh b/collection/jupyterlab/install.sh
deleted file mode 100644
index 45267b0..0000000
--- a/collection/jupyterlab/install.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-VERSION=${1:-"latest"}
-USERNAME=${2:-"automatic"}
-
-# If in automatic mode, determine if a user already exists, if not use vscode
-if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
- USERNAME=""
- POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
- for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
- if id -u ${CURRENT_USER} > /dev/null 2>&1; then
- USERNAME=${CURRENT_USER}
- break
- fi
- done
- if [ "${USERNAME}" = "" ]; then
- USERNAME=vscode
- fi
-elif [ "${USERNAME}" = "none" ]; then
- USERNAME=root
- USER_UID=0
- USER_GID=0
-fi
-
-# Use sudo to run as non-root user is not already running
-sudoUserIf()
-{
- if [ "$(id -u)" -eq 0 ] && [ "${USERNAME}" != "root" ]; then
- sudo -u ${USERNAME} "$@"
- else
- "$@"
- fi
-}
-
-# If we don't yet have Python, install it now.
-if ! python --version > /dev/null ; then
- echo "You need to install Python before installing JupyterLab."
- exit 1
-fi
-
-# If we don't already have JupyterLab installed, install it now.
-if ! jupyter-lab --version > /dev/null ; then
- echo "Installing JupyterLab..."
- if [ "${VERSION}" = "latest" ]; then
- pip install jupyterlab
- else
- pip install jupyterlab=="${VERSION}" --no-cache-dir
- fi
-fi