Restructured linux to match Windows

This commit is contained in:
Eric Ratliff
2026-01-24 12:39:32 -06:00
parent b1593a4f87
commit fd9c573131
30 changed files with 3120 additions and 1746 deletions

View File

@@ -1,33 +1,38 @@
#!/bin/bash
# Install FTC project generator
# FTC Project Generator - Installation Script
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INSTALL_DIR="/usr/local/bin"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
echo "FTC Project Generator - Installation"
echo "════════════════════════════════════════════════════════════════"
echo " FTC Project Generator - Installation"
echo "════════════════════════════════════════════════════════════════"
echo ""
# Check if running as root for system install
if [ -w "$INSTALL_DIR" ]; then
echo "Installing to $INSTALL_DIR (system-wide)..."
ln -sf "$SCRIPT_DIR/ftc-new-project" "$INSTALL_DIR/ftc-new-project"
echo "✓ Installed! Use 'ftc-new-project' from anywhere."
else
echo "No write access to $INSTALL_DIR"
echo ""
echo "Choose installation method:"
echo ""
echo "1. System-wide (requires sudo):"
echo " sudo $0"
echo ""
echo "2. User-only (no sudo needed):"
echo " mkdir -p ~/bin"
echo " ln -sf $SCRIPT_DIR/ftc-new-project ~/bin/ftc-new-project"
echo " echo 'export PATH=\$PATH:~/bin' >> ~/.bashrc"
echo " source ~/.bashrc"
echo ""
echo "3. Add this directory to PATH:"
echo " echo 'export PATH=\$PATH:$SCRIPT_DIR' >> ~/.bashrc"
echo " source ~/.bashrc"
# Check if we can write to install directory
if [ ! -w "$INSTALL_DIR" ]; then
echo "Cannot write to $INSTALL_DIR"
echo "Try: sudo ./install.sh"
echo "Or: INSTALL_DIR=~/.local/bin ./install.sh"
exit 1
fi
# Create symlink
echo "Installing to $INSTALL_DIR..."
if [ -L "$INSTALL_DIR/ftc-new-project" ]; then
rm "$INSTALL_DIR/ftc-new-project"
fi
ln -s "$SCRIPT_DIR/ftc-new-project" "$INSTALL_DIR/ftc-new-project"
echo "✓ Installed successfully"
echo ""
echo "You can now run from anywhere:"
echo " ftc-new-project my-robot"
echo ""
echo "To uninstall:"
echo " rm $INSTALL_DIR/ftc-new-project"
echo ""