|
@ -26,6 +26,24 @@ function ensure_venv { |
|
|
. "$VENV_PATH/bin/activate" |
|
|
. "$VENV_PATH/bin/activate" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function gimli_only { |
|
|
|
|
|
# Rovnou zkontrolujeme i uživatele |
|
|
|
|
|
if test "$HOSTNAME" != gimli -o "$USER" != mam-web |
|
|
|
|
|
then |
|
|
|
|
|
echo "Tento příkaz se má spouštět na gimlim, chceš pokračovat? Pokud ne, sestřel tento skript." |
|
|
|
|
|
read |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function only_in_directory { |
|
|
|
|
|
DIR="$1" |
|
|
|
|
|
CURRENT="$(readlink -f .)" |
|
|
|
|
|
if test "$CURRENT" != "$DIR" |
|
|
|
|
|
then |
|
|
|
|
|
echo "Tento příkaz se má spouštět ve složce $DIR, chceš pokračovat? Pokud ne, sestřel tento skript." |
|
|
|
|
|
read |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function safe_checkout_branch { |
|
|
function safe_checkout_branch { |
|
|
if "$#" -ne 2 |
|
|
if "$#" -ne 2 |
|
|