From 24c1701e086c1dd66bb68557be0c74d8f0d137eb Mon Sep 17 00:00:00 2001 From: quadrismegistus Date: Thu, 17 Sep 2020 06:01:59 +0100 Subject: [PATCH] komrade update! --- bin/komrade-reset | 17 +++++++++++++++++ komrade/backend/the_operator.py | 3 +++ script/install | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 bin/komrade-reset diff --git a/bin/komrade-reset b/bin/komrade-reset new file mode 100755 index 0000000..46e5e9b --- /dev/null +++ b/bin/komrade-reset @@ -0,0 +1,17 @@ +SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +wd=`pwd` +path=`realpath "$SCRIPTPATH/../../data"` +echo "Removing $path. You will permanently lose your users and contacts. Proceed? " + +read -p "[Y/n] " y_n + +echo $y_n + +if [ ! "$y_n" = "y" ]; then + echo "Cancelling" +else + rm -r $path + echo "Reregistering..." + komrade-cli /register +fi \ No newline at end of file diff --git a/komrade/backend/the_operator.py b/komrade/backend/the_operator.py index 67b47a0..c1ac156 100644 --- a/komrade/backend/the_operator.py +++ b/komrade/backend/the_operator.py @@ -284,6 +284,9 @@ class TheOperator(Operator): 'status': f"{OPERATOR_INTRO}I'm sorry, but I can't register the name of {name}." } + # save QR also? + self.save_uri_as_qrcode(uri_id=uri_id,name=name) + # compose result res = { 'success':success, diff --git a/script/install b/script/install index 2515f24..53fed4f 100644 --- a/script/install +++ b/script/install @@ -54,7 +54,7 @@ then echo "Use HTTPS or SSH for git?" read -p "[HTPS/ssh] " git_method - if [ git_method=="ssh" ] + if [ "$git_method" = "ssh" ] then echo "using ssh..." git clone git@github.com:Komrade/Komrade.git @@ -87,7 +87,7 @@ then echo "pyenv not installed. install?" read -p "[Y/n] " pyenv_yn - if [ ! pyenv_yn=="n" ]; then + if [ "$pyenv_yn" = "n" ]; then echo "Not installing pyenv." else export PYENV_ROOT="$HOME/.pyenv"