fix: 如果找不到files文件夹, 跳过复制

This commit is contained in:
Olia Lisa
2026-06-27 13:23:29 +08:00
parent 60e539a694
commit 3ffeb904bb
2 changed files with 13 additions and 2 deletions
+7 -1
View File
@@ -129,7 +129,13 @@ build(){
cd "$BUILDER_DIR"
mkdir -p "$FILES_DIR"
cp "${SCRIPT_DIR}"/files/* "$BUILDER_DIR/files/" -rf
# 复制 files 目录下的自定义文件到 Image Builder 的 files 目录
if [ -d "${SCRIPT_DIR}/files" ]; then
echo -e "${YELLOW}[提示] 复制自定义 files/ 目录到 Image Builder${NC}"
cp ${SCRIPT_DIR}/files/* $BUILDER_DIR/files/ -rf
else
echo -e "${YELLOW}[提示] 未找到自定义 files/ 目录,跳过复制${NC}"
fi
# 禁用 x86 Image Builder 中常见的额外镜像格式;rockchip 目标不存在时会自动跳过
sed -i \
+6 -1
View File
@@ -136,7 +136,12 @@ build(){
cd "$BUILDER_DIR"
# 复制 files 目录下的自定义文件到 Image Builder 的 files 目录
cp ${SCRIPT_DIR}/files/* $BUILDER_DIR/files/ -rf
if [ -d "${SCRIPT_DIR}/files" ]; then
echo -e "${YELLOW}[提示] 复制自定义 files/ 目录到 Image Builder${NC}"
cp ${SCRIPT_DIR}/files/* $BUILDER_DIR/files/ -rf
else
echo -e "${YELLOW}[提示] 未找到自定义 files/ 目录,跳过复制${NC}"
fi
# 修改.config文件, 不构建以下格式固件
sed -i \