Skip to content

Commit

Permalink
changement path env-config
Browse files Browse the repository at this point in the history
  • Loading branch information
cdebarros committed Feb 20, 2024
1 parent 32dc4e8 commit d6fd212
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# Recreate config file
# rm -rf ./env-config.js
# touch ./env-config.js
chmod 777 ./env-config.js
touch /mem/env-config.js

# Add assignment
echo "window._env_ = {" >> ./env-config.js
echo "window._env_ = {" >> /mem/env-config.js

# Read each line in .env file
# Each line represents key=value pairs
Expand All @@ -23,7 +23,9 @@ do
[[ -z $value ]] && value=${varvalue}

# Append configuration property to JS file
echo " $varname: \"$value\"," >> ./env-config.js
echo " $varname: \"$value\"," >> /mem/env-config.js
done < .env

echo "}" >> ./env-config.js
echo "}" >> /mem/env-config.js

mv /mem/env-config.js /usr/share/nginx/html/

0 comments on commit d6fd212

Please # to comment.