From 9cbc5c37b87421c40e9b7ebf86114c4e17687f2f Mon Sep 17 00:00:00 2001 From: sHa Date: Fri, 7 Jun 2019 10:52:51 +0300 Subject: [PATCH] scripts update --- package.json | 2 +- scripts/git.storage_push.sh | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 869fd20..d673aad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sscripts", - "version": "1.0.2", + "version": "1.0.3", "description": "Useful Shell scripts for projects", "author": "sHa ", "license": "MIT", diff --git a/scripts/git.storage_push.sh b/scripts/git.storage_push.sh index a63a00c..5b5f702 100755 --- a/scripts/git.storage_push.sh +++ b/scripts/git.storage_push.sh @@ -8,7 +8,22 @@ # DIR=$(dirname $BASH_SOURCE) -PROJECT=$(cd $DIR"/.."; pwd) +PROJECT=(${DIR//node_modules/ }) + +if [ ! -d $PROJECT/storage ]; then + echo "ERROR: '$PROJECT/storage' dir not found" + exit 1 +fi + +gity --version 2>&1 >/dev/null +GIT_IS_AVAILABLE=$? +if [ ! $GIT_IS_AVAILABLE -eq 0 ]; then + echo "ERROR: The program 'git' is currently not installed." + echo "Try: 'sudo apt install git' to install it" + exit 1 +fi + + cd $PROJECT/storage git add . --all &&