mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 14:22:02 +00:00
This commit introduces a new feature for managing worktree initialization scripts, allowing users to configure and execute scripts upon worktree creation. Key changes include: 1. **New API Endpoints**: Added endpoints for getting, setting, and deleting init scripts. 2. **Worktree Routes**: Updated worktree routes to include init script handling. 3. **Init Script Service**: Created a service to execute the init scripts asynchronously, with support for cross-platform compatibility. 4. **UI Components**: Added UI components for displaying and editing init scripts, including a dedicated section in the settings view. 5. **Event Handling**: Implemented event handling for init script execution status, providing real-time feedback in the UI. This enhancement improves the user experience by allowing automated setup processes for new worktrees, streamlining project workflows.
27 lines
825 B
Bash
27 lines
825 B
Bash
#!/bin/bash
|
|
# Example worktree init script for Automaker
|
|
# Copy this content to Settings > Worktrees > Init Script
|
|
# Or save directly as .automaker/worktree-init.sh in your project
|
|
|
|
echo "=========================================="
|
|
echo " Worktree Init Script Starting..."
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Current directory: $(pwd)"
|
|
echo "Branch: $(git branch --show-current 2>/dev/null || echo 'unknown')"
|
|
echo ""
|
|
|
|
# Install dependencies
|
|
echo "[1/1] Installing npm dependencies..."
|
|
if [ -f "package.json" ]; then
|
|
npm install
|
|
echo "Dependencies installed successfully!"
|
|
else
|
|
echo "No package.json found, skipping npm install"
|
|
fi
|
|
echo ""
|
|
|
|
echo "=========================================="
|
|
echo " Worktree initialization complete!"
|
|
echo "=========================================="
|