-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_setenv.sh
More file actions
executable file
·49 lines (38 loc) · 1019 Bytes
/
app_setenv.sh
File metadata and controls
executable file
·49 lines (38 loc) · 1019 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
#### Description: Creates an .env file from xx_XXenv files in alpabethical order
#### Written by: Guillermo de Ignacio - gdeignacio on 12-2022
### Revision 2024-08-01
##############################
### SETUP ENV VALUES ###
##############################
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
echo 'Usage: ./app_setenv.sh
Creates an .env file from xx_XXenv files in alpabethical order
'
exit
fi
echo ""
PROJECT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
echo "Project path at $PROJECT_PATH"
echo ""
echo "[$(date +"%Y-%m-%d %T")] Getting to create folder..."
echo ""
touch .environment
for FILE in settings/[0-9]*; do
if [[ ${FILE} == *.backup ]]
then
echo "Skiping backup file: "$FILE
else
echo "Loading: "$FILE
echo $'\n' >> .environment
cat $FILE >> .environment
fi
done
echo ""
mv .environment .env