Skip to content
Snippets Groups Projects
Commit 64ec44ce authored by Michael Langguth's avatar Michael Langguth
Browse files

Ensure that 'create_env.sh' and 'generate_workflow_runscripts.sh' can only be...

Ensure that 'create_env.sh' and 'generate_workflow_runscripts.sh' can only be executed from the env_setup-directory.
parent 1afbe369
No related branches found
No related tags found
No related merge requests found
Pipeline #46893 failed
......@@ -46,7 +46,7 @@ ENV_DIR=${WORKING_DIR}/${ENV_NAME}
# * check if virtual env has already been set up
if [[ "${EXE_DIR}" != "env_setup" ]]; then
echo "ERROR: The setup-script for the virtual environment from the env_setup-directory!"
echo "ERROR: Execute 'create_env.sh' from the env_setup-subdirectory only!"
return
fi
......
#!/usr/bin/env bash
#
# __authors__ = Michael Langguth
# __date__ = '2020_09_24'
# __date__ = '2020_09_29'
#
# **************** Description ****************
# Converts a given template workflow script (path/name has to be passed as first argument) to
......@@ -52,8 +52,14 @@ add_exp_dir() {
HOST_NAME=`hostname`
BASE_DIR=`pwd`
WORKING_DIR="$(dirname "$BASE_DIR")"
EXE_DIR="$(basename "$BASE_DIR")"
### Some sanity checks ###
# ensure that the script is executed from the env_setup-subdirectory
if [[ "${EXE_DIR}" != "env_setup" ]]; then
echo "ERROR: Execute 'generate_workflow_scripts.sh' from the env_setup-subdirectory only!"
exit 1
fi
# check input arguments
if [[ "$#" -lt 2 ]]; then
echo "ERROR: Pass path to workflow runscript (without '_template.sh') and pass name of virtual environment..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment