From d20bb74d37f9c7fe18aada1cab131b607ce9bda9 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 1 Aug 2024 14:22:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 --- front/replace_underscore.sh | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b50edf86..095dc18c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,11 @@ WORKDIR /app COPY front/package*.json ./ RUN npm install COPY front/. . -RUN ls -l /app/ RUN npm run generate COPY front/replace_underscore.sh ./ -RUN ls -l /app/.output/public/_nuxt RUN chmod +x /app/replace_underscore.sh RUN apk add --no-cache dos2unix && dos2unix /app/replace_underscore.sh RUN /app/replace_underscore.sh -RUN ls -l /app/.output/public/_nuxt FROM golang:1.22.5-alpine as backend ENV CGO_ENABLED 1 diff --git a/front/replace_underscore.sh b/front/replace_underscore.sh index 6f3c695d..9174767b 100644 --- a/front/replace_underscore.sh +++ b/front/replace_underscore.sh @@ -33,7 +33,7 @@ find "$TARGET_DIR" -type f -name '_*' | while read -r file; do fi # 更新所有引用到这个文件的地方 - find "$dir" -type f -exec sed -i "s|$file|$dir/$new_file|g" {} + + find "$dir" -type f -exec sed -i "s|$base_file|$new_file|g" {} + else echo "File $file does not start with an underscore, skipping." fi