From 8ef21045cfa58f7b68572f8b996433456e1bab8f Mon Sep 17 00:00:00 2001 From: Aralhi Date: Wed, 3 Jan 2024 10:27:28 +0800 Subject: [PATCH] feat: .env should not build to static asset --- scripts/build_web_static.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/build_web_static.sh b/scripts/build_web_static.sh index 99537e291..53edef72e 100755 --- a/scripts/build_web_static.sh +++ b/scripts/build_web_static.sh @@ -10,9 +10,24 @@ WORK_DIR="$WORK_DIR/.." cd $WORK_DIR/web +source_env=".env" +tmp_env=".env.copy" + +if [ -e "$source_env" ]; then + cp "$source_env" "$tmp_env" + rm -rf "$source_env" +else + echo "Do not find .env" +fi + npm install npm run build rm -rf ../dbgpt/app/static/* -cp -R ../web/out/* ../dbgpt/app/static \ No newline at end of file +cp -R ../web/out/* ../dbgpt/app/static + +if [ -e "$tmp_env" ]; then + cp "$tmp_env" "$source_env" + rm -rf "$tmp_env" +fi \ No newline at end of file