-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_env.sh
More file actions
executable file
·35 lines (27 loc) · 784 Bytes
/
set_env.sh
File metadata and controls
executable file
·35 lines (27 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# Remove any pre-existing export.sh fle
if [ -f exports.sh ]; then
rm exports.sh
fi
# Create a new blank exports file
touch exports.sh
# List of required API services
APIServices=(
# Add API Services here for example:
# RESOURCE_API
# NODE_ENV
# SECRET_TOKEN
# Note items in the APIServices array are separated by a new line.
)
# Loop through each API service and prompt the user for a key
for service in "${APIServices[@]}"; do
read -p "Enter the value for $service: " value
# Write key to exports file
echo "export $service=\"$value\"" >> exports.sh
done
completionMessage="
Alright! API key value pairs have been saved to exports.sh.
Make sure exports.sh is on your .gitignore file.
The app is now ready to run.
"
printf "$completionMessage"