Files
ComfyUI-Lora-Manager/vue-widgets/pre-commit.example
Will Miao 32249d1886 feat: add Vue widget demo node and development support
- Add LoraManagerDemoNode to node mappings for Vue widget demonstration
- Update .gitignore to exclude Vue widget development artifacts (node_modules, .vite, dist)
- Implement automatic Vue widget build check in development mode with fallback handling
- Maintain pytest compatibility with proper import error handling
2026-01-10 17:45:26 +08:00

38 lines
1016 B
Bash

#!/bin/sh
#
# Example pre-commit hook to ensure Vue widgets are built before committing
#
# To use this hook:
# 1. Copy this file to .git/hooks/pre-commit
# 2. Make it executable: chmod +x .git/hooks/pre-commit
#
# Or use a tool like Husky for automatic hook management:
# npm install --save-dev husky
# npx husky install
# npx husky add .git/hooks/pre-commit "cd vue-widgets && npm run build"
echo "Running pre-commit hook: Building Vue widgets..."
# Navigate to vue-widgets directory and build
cd "$(git rev-parse --show-toplevel)/vue-widgets" || exit 1
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "node_modules not found, running npm install..."
npm install || exit 1
fi
# Build Vue widgets
npm run build || {
echo "❌ Vue widget build failed! Commit aborted."
echo "Please fix the build errors before committing."
exit 1
}
# Add built files to the commit
cd ..
git add web/comfyui/vue-widgets/
echo "✓ Vue widgets built and staged successfully"
exit 0