From 5bee8480a6a8d1f723966c4541d095709988a9ad Mon Sep 17 00:00:00 2001 From: marxzuckerburg Date: Tue, 29 Sep 2020 19:20:51 +0100 Subject: [PATCH] comrad update! --- bin/comrad-activate | 8 ++++++++ bin/comrad-apocalype | 9 +++++++++ bin/comrad-cli | 4 +--- bin/comrad-op | 5 ++--- bin/comrad-reset | 15 ++++++++------- bin/comrad-update | 13 ++++++++++--- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/bin/comrad-activate b/bin/comrad-activate index 4cb9ea4..e7b19ac 100755 --- a/bin/comrad-activate +++ b/bin/comrad-activate @@ -1,3 +1,11 @@ +#!/bin/bash + +# funcs (mac doesnt have realpath) +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + + path_conda="`realpath ~/comrad/lib/miniconda3`" path_venv="`realpath ~/comrad/code/venv`" path_repo="`realpath ~/comrad/code`" diff --git a/bin/comrad-apocalype b/bin/comrad-apocalype index 9333b84..465bca4 100755 --- a/bin/comrad-apocalype +++ b/bin/comrad-apocalype @@ -1,3 +1,12 @@ +#!/bin/bash + +# funcs (mac doesnt have realpath) +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + + + path_com_bin="`realpath ~/comrad/code/bin`" path_conda="`realpath ~/comrad/lib/miniconda3`" path_venv="`realpath ~/comrad/code/venv`" diff --git a/bin/comrad-cli b/bin/comrad-cli index 3e06e89..d348ff3 100755 --- a/bin/comrad-cli +++ b/bin/comrad-cli @@ -1,6 +1,4 @@ -## -# Run the command line app -## +#!/bin/bash # funcs (mac doesnt have realpath) realpath() { diff --git a/bin/comrad-op b/bin/comrad-op index 06612db..306aae1 100755 --- a/bin/comrad-op +++ b/bin/comrad-op @@ -1,12 +1,11 @@ -## -# Run THE OPERATOR -## +#!/bin/bash # funcs (mac doesnt have realpath) realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } + path_conda="`realpath ~/comrad/lib/miniconda3`" path_venv="`realpath ~/comrad/code/venv`" path_repo="`realpath ~/comrad/code`" diff --git a/bin/comrad-reset b/bin/comrad-reset index a6b9455..b084900 100755 --- a/bin/comrad-reset +++ b/bin/comrad-reset @@ -1,8 +1,11 @@ -SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +#!/bin/bash -wd=`pwd` -path=`realpath "$SCRIPTPATH/../../data"` -echo "Removing $path. You will permanently lose your users and contacts. Proceed? " +# funcs (mac doesnt have realpath) +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} +pathdata="`realpath ~/comrad/data`" +echo "Removing $pathdata. You will permanently lose your users and contacts. Proceed? " read -p "[y/N] " y_n @@ -11,7 +14,5 @@ echo $y_n if [ ! "$y_n" = "y" ]; then echo "Cancelling" else - rm -r $path - #echo "Reregistering..." - #comrad-cli /register + rm -r $pathdata fi \ No newline at end of file diff --git a/bin/comrad-update b/bin/comrad-update index 1c86c0f..e30712a 100755 --- a/bin/comrad-update +++ b/bin/comrad-update @@ -1,8 +1,15 @@ -SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +#!/bin/bash +# funcs (mac doesnt have realpath) +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + + +path_repo="`realpath ~/comrad/code`" wd=`pwd` -path=`realpath "$SCRIPTPATH/.."` -cd $path + +cd $path_repo git pull git add . git commit -m 'comrad update!'