From 29d8596272071fa7f933a0e1b4ec9da74d9f3226 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 25 Apr 2024 16:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.json | 2 +- start.sh | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/components.json b/components.json index ec28987..cbffd3d 100644 --- a/components.json +++ b/components.json @@ -4,7 +4,7 @@ "typescript": true, "tailwind": { "config": "tailwind.config.ts", - "css": "assets/index.css", + "css": "assets/css/index.css", "baseColor": "stone", "cssVariables": true }, diff --git a/start.sh b/start.sh index 699de0c..4c7d758 100644 --- a/start.sh +++ b/start.sh @@ -5,16 +5,12 @@ npx prisma migrate deploy export VERSION=$(cat /app/version) - CONFIG_FILE="/app/config" if [ -f "$CONFIG_FILE" ]; then + # 使用进程替换来过滤掉注释行 while IFS='=' read -r key value; do - if [[ -z "$key" ]]; then - continue - fi - - if [[ $key == \#* ]]; then + if [[ -z "$key" ]] || [[ $key == \#* ]]; then continue fi @@ -22,9 +18,6 @@ if [ -f "$CONFIG_FILE" ]; then continue fi - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # 检查环境变量是否已经存在,存在则忽略 if [ -z "$(printenv "$key")" ]; then export "$key"="$value" @@ -32,7 +25,7 @@ if [ -f "$CONFIG_FILE" ]; then else echo "环境变量 $key 已经存在,忽略" fi - done < "$CONFIG_FILE" + done < <(cat "$CONFIG_FILE" | grep -v '^#') else echo "配置文件 $CONFIG_FILE 不存在,忽略读取并导出环境变量的过程" fi