Skip to content

Commit

Permalink
generate_env.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg3lopez committed Oct 23, 2023
1 parent c7cb2c0 commit a0c56ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions generate_env.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit a0c56ad

Please sign in to comment.