Created
June 25, 2018 12:27
-
-
Save avdeev/aa024336dbe139eec3d8b3f6d97ef8b2 to your computer and use it in GitHub Desktop.
Usage envsubst for starting SPA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="mobile-web-app-capable" content="yes"> | |
<title>Title</title> | |
</head> | |
<body> | |
<script> | |
config_obj.node_env = ${NODE_ENV} | |
config_obj.app_env = ${APP_ENV} | |
config_obj.version = ${VERSION} | |
</script> | |
<noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript> | |
<div id="app"></div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export NODE_ENV=some_outside_info_1 | |
export APP_ENV=some_outside_info_2 | |
export VERSION=some_outside_info_3 | |
set -x | |
for FILE in $(find ./ -name '*.envtmpl'); do | |
FILE_STRIPPED="${FILE%.*}" | |
envsubst < ${FILE} > ${FILE_STRIPPED} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment