From 7560da383451e8f482a9c9d1ba66c2c2693f1370 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Wed, 20 Apr 2022 02:15:57 +0200 Subject: [PATCH] Add shared bash functions --- .gitignore | 3 --- scripts/shared.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 scripts/shared.sh diff --git a/.gitignore b/.gitignore index 63350a1..2d7e9dc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,5 @@ __pycache__ # Database db/ -# Server setup documentation -server_setup.adoc - # Development .flaskenv diff --git a/scripts/shared.sh b/scripts/shared.sh new file mode 100644 index 0000000..70b01e1 --- /dev/null +++ b/scripts/shared.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +box() { + MESSAGE="$2$1" + SEPERATOR="==${MESSAGE//?/=}==" + + echo + echo "$SEPERATOR" + echo "| $MESSAGE |" + echo "$SEPERATOR" + echo +} + +step() { + CONTINUE_MESSAGE="-> Press ENTER to continue or Ctrl+C to interrupt the script <-" + UPPER_SEPERATOR="${CONTINUE_MESSAGE//?/_}" + + echo + echo "$UPPER_SEPERATOR" + + box "$1" "Next step: " + + echo "$CONTINUE_MESSAGE" + read -s + echo +} + +install_latest_pipx() { + pip install --user --upgrade pipx +} + +poetry_install_latest() { + cd "$SDIR/.." + poetry install +}