mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Allow ssh git urls not just web for theme installs
Closes #3916 Co-authored-by: @Vargrul
This commit is contained in:
@@ -3,10 +3,11 @@
|
|||||||
# omarchy:summary=Install a theme from a git repository
|
# omarchy:summary=Install a theme from a git repository
|
||||||
# omarchy:args=[git-repo-url]
|
# omarchy:args=[git-repo-url]
|
||||||
# omarchy:examples=omarchy theme install https://github.com/example/omarchy-example-theme.git
|
# 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
|
if [[ -z $1 ]]; then
|
||||||
echo -e "\e[32mSee https://manuals.omamix.org/2/the-omarchy-manual/90/extra-themes\n\e[0m"
|
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
|
else
|
||||||
REPO_URL="$1"
|
REPO_URL="$1"
|
||||||
fi
|
fi
|
||||||
@@ -16,7 +17,11 @@ if [[ -z $REPO_URL ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
THEMES_DIR="$HOME/.config/omarchy/themes"
|
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"
|
THEME_PATH="$THEMES_DIR/$THEME_NAME"
|
||||||
|
|
||||||
# Remove existing theme if present
|
# Remove existing theme if present
|
||||||
|
|||||||
Reference in New Issue
Block a user