Skip to content

Instantly share code, notes, and snippets.

@randallb
Created August 8, 2025 15:27
Show Gist options
  • Save randallb/a3ed277429a4311d2735ad88064d6318 to your computer and use it in GitHub Desktop.
Save randallb/a3ed277429a4311d2735ad88064d6318 to your computer and use it in GitHub Desktop.
rbnix Bootstrap Script for Fresh Mac Setup
#!/bin/bash
# Minimal Bootstrap Stub for rbnix
# This is what you'd put in a GitHub Gist and curl from a fresh Mac
#
# Usage:
# curl -fsSL https://gist.github.com/randallb/YOUR_GIST_ID/raw/bootstrap.sh | bash
#
# Or with a custom repo:
# curl -fsSL https://gist.github.com/randallb/YOUR_GIST_ID/raw/bootstrap.sh | bash -s -- --repo https://github.com/yourusername/yourrepo.git
set -e
# Default configuration (update these for your setup)
DEFAULT_REPO="https://github.com/randallb/rbpara.git"
DEFAULT_BRANCH="main"
# Parse arguments
REPO_URL="$DEFAULT_REPO"
BRANCH="$DEFAULT_BRANCH"
while [[ $# -gt 0 ]]; do
case $1 in
--repo)
REPO_URL="$2"
shift 2
;;
--branch)
BRANCH="$2"
shift 2
;;
*)
shift
;;
esac
done
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "${GREEN}πŸš€ Starting rbnix bootstrap...${NC}"
echo ""
echo "Repository: $REPO_URL"
echo "Branch: $BRANCH"
echo ""
# Create temp directory
TEMP_DIR=$(mktemp -d)
echo -e "${YELLOW}β†’ Using temp directory: $TEMP_DIR${NC}"
# Download the full bootstrap script
echo -e "${YELLOW}β†’ Downloading bootstrap script...${NC}"
curl -fsSL -o "$TEMP_DIR/bootstrap.sh" \
"https://raw.githubusercontent.com/${REPO_URL#https://github.com/}/${BRANCH}/3-resources/rbnix/bootstrap.sh"
# Make it executable
chmod +x "$TEMP_DIR/bootstrap.sh"
# Update the repo URL in the downloaded script
sed -i '' "s|^REPO_URL=.*|REPO_URL=\"$REPO_URL\"|" "$TEMP_DIR/bootstrap.sh"
# Run the full bootstrap
echo -e "${YELLOW}β†’ Running full bootstrap...${NC}"
"$TEMP_DIR/bootstrap.sh"
# Cleanup
rm -rf "$TEMP_DIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment