From a0c56adac673c6846e14c6559e7d011df0308362 Mon Sep 17 00:00:00 2001 From: jorge Lopez Date: Mon, 23 Oct 2023 15:22:27 -0700 Subject: [PATCH] generate_env.sh --- generate_env.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 generate_env.sh diff --git a/generate_env.sh b/generate_env.sh new file mode 100755 index 000000000..e385b5685 --- /dev/null +++ b/generate_env.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Define the content of the .env file +env_content="ENV=local\nKEY_VAULT-NAME=ti-key-vault-name\nREPORT_STREAM_URL_PREFIX=http://localhost:7071" + +# Get directory of script file +script_dir="$(dirname "$0")" + +# Path to the resource folder +folder_path="$script_dir/shared/src/main/resources" + +# Check if folder exists, and create if if not +if [ ! -d "$folder_path" ]; then + mkdir -p "$folder_path" || { echo "Error creating directory."; exit 1; } +fi + +# Create or overwrite the .env file +echo -e "$env_content" > "$folder_path/.env" || { echo "Error creating .env file."; exit 1; } + +# Display comments +echo "The .env file has been created in $folder_path with the following content: " +echo -e "$env_content"