Files
keyboard/check_files.sh

70 lines
1.9 KiB
Bash
Raw Permalink Normal View History

2026-03-02 09:19:06 +08:00
#!/bin/bash
echo "========================================"
echo "检查新增文件是否存在"
echo "========================================"
echo ""
files=(
"Shared/Resource/kb_input_profiles.json"
"Shared/KBInputProfileManager.h"
"Shared/KBInputProfileManager.m"
"CustomKeyboard/Manager/KBKeyboardLayoutResolver.h"
"CustomKeyboard/Manager/KBKeyboardLayoutResolver.m"
)
modified_files=(
"CustomKeyboard/Resource/kb_keyboard_layout_config.json"
"CustomKeyboard/View/KBKeyboardView.h"
"CustomKeyboard/View/KBKeyboardView.m"
"CustomKeyboard/View/KBKeyBoardMainView.h"
"CustomKeyboard/View/KBKeyBoardMainView.m"
"CustomKeyboard/KeyboardViewController.m"
"CustomKeyboard/Manager/KBSuggestionEngine.h"
"CustomKeyboard/Manager/KBSuggestionEngine.m"
"keyBoard/Class/Me/VC/KBPersonInfoVC.m"
)
base_path="/Users/mac/Desktop/项目/公司/KeyBoard"
echo "新增文件检查:"
echo "----------------------------------------"
all_new_exist=true
for file in "${files[@]}"; do
full_path="$base_path/$file"
if [ -f "$full_path" ]; then
echo "$file"
else
echo "$file (文件不存在)"
all_new_exist=false
fi
done
echo ""
echo "修改文件检查:"
echo "----------------------------------------"
all_modified_exist=true
for file in "${modified_files[@]}"; do
full_path="$base_path/$file"
if [ -f "$full_path" ]; then
echo "$file"
else
echo "$file (文件不存在)"
all_modified_exist=false
fi
done
echo ""
echo "========================================"
if [ "$all_new_exist" = true ] && [ "$all_modified_exist" = true ]; then
echo "✅ 所有文件检查通过!"
echo ""
echo "下一步:"
echo "1. 在 Xcode 中添加新增文件到工程"
echo "2. 编译主 App 和扩展"
echo "3. 运行测试"
else
echo "❌ 部分文件缺失,请检查!"
fi
echo "========================================"