#!/usr/bin/env bash set -euo pipefail # Bootstrap installer for 1Shad0w/DarkShadowShell (dotfiles ยท dev branch) # Served via https://get.aurorian.es/dotfiles-dev REPO_URL="https://github.com/1Shad0w/DarkShadowShell.git" TARGET_DIR="${HOME}/shadows-shell" BRANCH="${BRANCH:-dev}" INSTALL_ARGS=() while [ "$#" -gt 0 ]; do case "$1" in --branch) if [ "$#" -lt 2 ]; then echo "--branch requires a branch name" >&2 exit 1 fi BRANCH="$2" shift 2 ;; --branch=*) BRANCH="${1#--branch=}" shift ;; *) INSTALL_ARGS+=("$1") shift ;; esac done if ! command -v git >/dev/null 2>&1; then echo "git is required. Install git and run again." >&2 exit 1 fi if [ -d "${TARGET_DIR}/.git" ]; then echo "Updating existing repository (${BRANCH}) in ${TARGET_DIR}..." git -C "${TARGET_DIR}" fetch origin "${BRANCH}" git -C "${TARGET_DIR}" checkout -B "${BRANCH}" "origin/${BRANCH}" git -C "${TARGET_DIR}" pull --ff-only origin "${BRANCH}" else echo "Cloning ${REPO_URL} (${BRANCH}) into ${TARGET_DIR}..." git clone --branch "${BRANCH}" "${REPO_URL}" "${TARGET_DIR}" fi cd "${TARGET_DIR}" if [ -r /dev/tty ]; then exec ./install.sh "${INSTALL_ARGS[@]+"${INSTALL_ARGS[@]}"}"