#!/usr/bin/env bash # Clones divvyup-app + divvyup, runs install.sh. Usage: curl -sSL https://install.builtbyjm.com/divvyup.sh | bash # Private repos: set DIVVYUP_APP_REPO and DIVVYUP_BACKEND_REPO with a token in the URL so git doesn't prompt. set -e INSTALL_DIR="${1:-./divvyup}" INSTALL_DIR="$(cd "$(dirname "$INSTALL_DIR")" 2>/dev/null && pwd)/$(basename "$INSTALL_DIR")" FRONTEND_REPO="${DIVVYUP_APP_REPO:-https://github.com/johncormier93/divvyup-app.git}" BACKEND_REPO="${DIVVYUP_BACKEND_REPO:-https://github.com/johncormier93/divvyup.git}" BRANCH="${DIVVYUP_BRANCH:-main}" echo "" echo " DivvyUp installer" echo " Install to: $INSTALL_DIR" echo "" mkdir -p "$INSTALL_DIR" cd "$INSTALL_DIR" if [[ -d divvyup-app ]] && [[ -d divvyup ]]; then echo "Updating to latest..." (cd divvyup-app && git fetch origin && git reset --hard origin/"$BRANCH") (cd divvyup && git fetch origin && git reset --hard origin/"$BRANCH") else echo "Cloning DivvyUp (frontend + backend)..." [[ -d divvyup-app ]] || git clone --depth 1 --branch "$BRANCH" "$FRONTEND_REPO" divvyup-app [[ -d divvyup ]] || git clone --depth 1 --branch "$BRANCH" "$BACKEND_REPO" divvyup fi chmod +x divvyup-app/install.sh echo "" exec divvyup-app/install.sh