From 04f3f7c7c2c233235dbd7c7a868dc9bc641fd690 Mon Sep 17 00:00:00 2001 From: Mikhail Yumanov Date: Sun, 14 Mar 2021 17:16:45 +0300 Subject: [PATCH] CST-10 znick#336 Added check of executing run.sh with --- deploy_local_beta/run.sh | 8 ++++++-- deploy_local_beta/settings.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/deploy_local_beta/run.sh b/deploy_local_beta/run.sh index 986806dff..69fe2d275 100644 --- a/deploy_local_beta/run.sh +++ b/deploy_local_beta/run.sh @@ -1,6 +1,10 @@ -#!/bin/bash +# This file must be used with "source deploy_local_beta/run.sh" *from bash* +# you cannot run it directly -# Execute from anytask root +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi #TODO: check if exist: diff --git a/deploy_local_beta/settings.sh b/deploy_local_beta/settings.sh index 5f87c3911..6cf5b88c2 100644 --- a/deploy_local_beta/settings.sh +++ b/deploy_local_beta/settings.sh @@ -1,3 +1,12 @@ +# This file must be used with "source deploy_local_beta/settings.sh" *from bash* +# you cannot run it directly + +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi + + export ANYBETA_ROOT=$PWD export ANYBETA_DEPLOY="$PWD/deploy_local_beta"