mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
misc: added script for cli-tests env setup
This commit is contained in:
1
cli/.gitignore
vendored
1
cli/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.infisical.json
|
||||
dist/
|
||||
agent-config.test.yaml
|
||||
.test.env
|
||||
22
cli/scripts/export_test_env.sh
Normal file
22
cli/scripts/export_test_env.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
TEST_ENV_FILE=".test.env"
|
||||
|
||||
# Check if the .env file exists
|
||||
if [ ! -f "$TEST_ENV_FILE" ]; then
|
||||
echo "$TEST_ENV_FILE does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Export the variables
|
||||
while IFS='=' read -r key value
|
||||
do
|
||||
# Skip empty lines and lines starting with #
|
||||
if [[ -z "$key" || "$key" =~ ^\# ]]; then
|
||||
continue
|
||||
fi
|
||||
# Use eval to correctly handle values with spaces
|
||||
eval export $key='$value'
|
||||
done < "$TEST_ENV_FILE"
|
||||
|
||||
echo "Test environment variables set."
|
||||
Reference in New Issue
Block a user