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