Allow ssh git urls not just web for theme installs

Closes #3916
Co-authored-by: @Vargrul
This commit is contained in:
David Heinemeier Hansson
2026-05-03 19:36:50 +02:00
parent 10165f2799
commit 6370a673ed
+7 -2
View File
@@ -3,10 +3,11 @@
# omarchy:summary=Install a theme from a git repository
# omarchy:args=[git-repo-url]
# omarchy:examples=omarchy theme install https://github.com/example/omarchy-example-theme.git
# omarchy:examples=omarchy theme install git@github.com:example/omarchy-example-theme.git
if [[ -z $1 ]]; then
echo -e "\e[32mSee https://manuals.omamix.org/2/the-omarchy-manual/90/extra-themes\n\e[0m"
REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="")
REPO_URL=$(gum input --placeholder="Git repo URL (https or git@host:org/repo.git)" --header="")
else
REPO_URL="$1"
fi
@@ -16,7 +17,11 @@ if [[ -z $REPO_URL ]]; then
fi
THEMES_DIR="$HOME/.config/omarchy/themes"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//' | tr '[:upper:]' '[:lower:]')
# Strip user@host: prefix from scp-style SSH URLs so basename sees just the path
REPO_PATH="$REPO_URL"
[[ $REPO_PATH != *"://"* && $REPO_PATH == *:*/* ]] && REPO_PATH="${REPO_PATH#*:}"
THEME_NAME=$(basename "$REPO_PATH" .git | sed -E 's/^omarchy-//; s/-theme$//' | tr '[:upper:]' '[:lower:]')
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Remove existing theme if present