File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -28,34 +28,29 @@ file "$OUTPUT_PATH"
2828extension=" ${filename##* .} " # 获取文件扩展名
2929case $extension in
3030 gz)
31- echo " 处理 gz 格式... "
31+ echo " gz正在解压 $OUTPUT_PATH "
3232 gunzip -f " $OUTPUT_PATH " || true
33- final_name=" imm/custom.img"
33+ final_name=$( find imm -name ' *.img' -print -quit)
34+ mv " $final_name " " imm/custom.img"
3435 ;;
3536 zip)
36- echo " 处理 zip 格式... "
37+ echo " zip正在解压 $OUTPUT_PATH "
3738 unzip -j -o " $OUTPUT_PATH " -d imm/ # -j 忽略目录结构
3839 final_name=$( find imm -name ' *.img' -print -quit)
40+ mv " $final_name " " imm/custom.img"
3941 ;;
4042 xz)
41- echo " 处理 xz 格式... "
43+ echo " xz正在解压 $OUTPUT_PATH "
4244 xz -d --keep " $OUTPUT_PATH " # 保留原文件
4345 final_name=" ${OUTPUT_PATH% .* } "
46+ mv " $final_name " " imm/custom.img"
4447 ;;
4548 * )
4649 echo " ❌ 不支持的压缩格式: $extension "
4750 exit 1
4851 ;;
4952esac
5053
51- # 统一重命名
52- if [ -n " $final_name " ]; then
53- mv " $final_name " " imm/custom.img"
54- else
55- echo " ❌ ZIP 文件中未找到 .img 文件"
56- exit 1
57- fi
58-
5954
6055# 检查最终文件
6156if [ -f " imm/custom.img" ]; then
You can’t perform that action at this time.
0 commit comments