Removes debug thing, which was causing it to crash

This commit is contained in:
Aaron Louie 2020-05-17 09:50:00 -04:00
parent d6850f056c
commit 999eb18fcc
1 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
echo 'Substituting environment variables...'
# The first parameter is a comma-delimited list of paths to files which should be substituted
if [[ -z $1 ]]; then
echo 'ERROR: No target files given.'
@ -7,16 +9,17 @@ if [[ -z $1 ]]; then
fi
env_list='\$PRODUCTION \$API_URL \$IRB_URL \$HOME_ROUTE \$PORT0'
for i in $(echo $1 | sed "s/,/ /g")
for file_path in $(echo $1 | sed "s/,/ /g")
do
# Replace strings in the given file(s) in env_list
envsubst "$env_list" < "$i" > "$i".tmp && mv "$i".tmp "$i"
echo "replacing $env_list in $file_path"
# Set DEBUG=true in order to log the replaced file
if [ "$DEBUG" = true ] ; then
exec cat $i
fi
# Replace strings in the given file(s) in env_list
envsubst "$env_list" < "$file_path" > "$file_path".tmp && mv "$file_path".tmp "$file_path"
echo '...'
done
echo 'Finished substituting environment variables.'
# Execute all other commands with parameters
exec "${@:2}"