mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 13:12:12 -03:00
- 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
38 lines
1016 B
Bash
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
|