Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js file content truncated #3

Open
dcdh opened this issue Aug 5, 2022 · 1 comment
Open

js file content truncated #3

dcdh opened this issue Aug 5, 2022 · 1 comment

Comments

@dcdh
Copy link

dcdh commented Aug 5, 2022

cat $file | envsubst $EXISTING_VARS | tee $file

File content can be truncated to the first 65535 characters when replacing placeholders.

You should use a tmp file to read from.

#!/usr/bin/env sh
export EXISTING_VARS=$(printenv | awk -F= '{print $1}' | sed 's/^/\$/g' | paste -sd,);
for file in $JSFOLDER;
do
  if [ ! -f $file.tmp ]
  then
    cp $file $file.tmp
  fi
  cat $file.tmp | envsubst $EXISTING_VARS | tee $file
done
nginx -g 'daemon off;'
@kuntal-bh
Copy link

Thank you @dcdh . you are a life saver.

hartraft added a commit to hartraft/frontend-containers that referenced this issue Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants