mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-17 23:13:03 +08:00
29 lines
828 B
Bash
Executable File
29 lines
828 B
Bash
Executable File
#!/bin/bash
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
PRJECT_DIR="$SCRIPT_DIR/.."
|
|
|
|
cd "$PRJECT_DIR/src/gui/resources/ui"
|
|
|
|
file_count=$(ls *.ui 2>/dev/null | wc -l)
|
|
|
|
if [ $file_count -eq 0 ]; then
|
|
echo "[AutoLibrary compile] 错误: 未找到任何 .ui 文件"
|
|
exit 1
|
|
fi
|
|
|
|
echo "[AutoLibrary compile] 找到 $file_count 个 .ui 文件,开始编译..."
|
|
|
|
for file in *.ui; do
|
|
base_name=$(basename "$file" .ui)
|
|
output_file="Ui_${base_name}.py"
|
|
echo "[AutoLibrary compile] 正在编译: \"$file\" -> \"$output_file\""
|
|
|
|
if pyside6-uic "$file" -o "$output_file"; then
|
|
echo "[AutoLibrary compile] 文件 \"$file\" 编译成功,输出文件: \"$output_file\""
|
|
else
|
|
echo "[AutoLibrary compile] 文件 \"$file\" 编译失败"
|
|
fi
|
|
done
|
|
|
|
echo "[AutoLibrary compile] 所有操作完成。" |