docker: avoid crash when restarting container

This commit is contained in:
Patrik Oldsberg
2020-07-15 10:55:14 +02:00
parent f6dd091d7f
commit 686f396d2b
+4 -1
View File
@@ -22,7 +22,10 @@ function inject_config() {
>&2 echo "Runtime app config: $config"
local main_js
main_js="$(grep -l __APP_INJECTED_RUNTIME_CONFIG__ /usr/share/nginx/html/*.chunk.js)"
if ! main_js="$(grep -l __APP_INJECTED_RUNTIME_CONFIG__ /usr/share/nginx/html/*.chunk.js)"; then
echo "Runtime config already written"
return
fi
echo "Writing runtime config to ${main_js}"
# escape ' and " twice, for both sed and json