feat: add actionwire
This commit is contained in:
91
install.sh
91
install.sh
@@ -166,6 +166,80 @@ install_synchan() {
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
# Function to install actionwire
|
||||
install_actionwire() {
|
||||
local actionwire_dir="$HOME/actionwire"
|
||||
|
||||
if [ -d "$actionwire_dir" ]; then
|
||||
print_warning "Actionwire directory already exists at $actionwire_dir"
|
||||
read -p "Do you want to remove the existing directory and reinstall? [y/N]: " -n 1 -r
|
||||
echo ""
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
print_status "Removing existing actionwire directory..."
|
||||
rm -rf "$actionwire_dir"
|
||||
else
|
||||
print_status "Skipping actionwire installation"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
print_status "Installing actionwire from https://github.com/lancatlin/actionwire..."
|
||||
|
||||
# Check if git is available
|
||||
if ! command_exists git; then
|
||||
print_error "Git is required to install actionwire. Please install Git first."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check if poetry is available
|
||||
if ! command_exists poetry; then
|
||||
print_status "Poetry not found, installing poetry..."
|
||||
brew install poetry
|
||||
print_status "Poetry installed"
|
||||
fi
|
||||
|
||||
# Clone the repository
|
||||
print_status "Cloning actionwire repository..."
|
||||
if git clone https://github.com/lancatlin/actionwire.git "$actionwire_dir"; then
|
||||
print_success "Repository cloned successfully"
|
||||
else
|
||||
print_error "Failed to clone actionwire repository"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Navigate to the directory and install dependencies
|
||||
print_status "Installing dependencies with poetry..."
|
||||
cd "$actionwire_dir"
|
||||
|
||||
if poetry install; then
|
||||
print_success "Dependencies installed successfully"
|
||||
print_success "Actionwire installed at: $actionwire_dir"
|
||||
print_status "To use actionwire, navigate to: cd $actionwire_dir"
|
||||
else
|
||||
print_warning "Poetry install failed, trying pip install as fallback..."
|
||||
if [ -f "requirements.txt" ]; then
|
||||
if python3 -m pip install -r requirements.txt; then
|
||||
print_success "Dependencies installed successfully with pip"
|
||||
print_success "Actionwire installed at: $actionwire_dir"
|
||||
print_status "To use actionwire, navigate to: cd $actionwire_dir"
|
||||
else
|
||||
print_error "Failed to install dependencies with both poetry and pip"
|
||||
return 1
|
||||
fi
|
||||
elif [ -f "pyproject.toml" ]; then
|
||||
print_warning "pyproject.toml found but poetry failed. You may need to install dependencies manually."
|
||||
print_status "Try running: cd $actionwire_dir && poetry install"
|
||||
print_success "Actionwire cloned at: $actionwire_dir"
|
||||
else
|
||||
print_error "No requirements.txt or pyproject.toml found, and poetry install failed"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Return to original directory
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
# Function to install additional useful tools
|
||||
install_additional_tools() {
|
||||
print_status "Installing additional useful development tools..."
|
||||
@@ -221,12 +295,19 @@ verify_installations() {
|
||||
else
|
||||
print_warning "⚠ Synchan: Not installed"
|
||||
fi
|
||||
|
||||
# Check actionwire installation
|
||||
if [ -d "$HOME/actionwire" ]; then
|
||||
print_success "✓ Actionwire: Installed at $HOME/actionwire"
|
||||
else
|
||||
print_warning "⚠ Actionwire: Not installed"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
main() {
|
||||
print_status "Starting Mac development environment setup..."
|
||||
print_status "This script will install: Git, Node.js, Python, Homebrew, and optionally synchan"
|
||||
print_status "This script will install: Git, Node.js, Python, Homebrew, and optionally synchan and actionwire"
|
||||
echo ""
|
||||
|
||||
# Check if running on macOS
|
||||
@@ -248,6 +329,14 @@ main() {
|
||||
install_synchan
|
||||
fi
|
||||
|
||||
# Ask if user wants to install actionwire
|
||||
echo ""
|
||||
read -p "Do you want to install actionwire from GitHub? [y/N]: " -n 1 -r
|
||||
echo ""
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
install_actionwire
|
||||
fi
|
||||
|
||||
# Ask if user wants additional tools
|
||||
echo ""
|
||||
read -p "Do you want to install additional development tools (VS Code, iTerm2, etc.)? [y/N]: " -n 1 -r
|
||||
|
||||
Reference in New Issue
Block a user