From 4f486821bbfa0cac0bf91846599d0d0ea23b3fdf Mon Sep 17 00:00:00 2001 From: Hans Goor Date: Sun, 4 Aug 2024 10:51:46 +0200 Subject: [PATCH] Add a dash to the allowed characters for clone --- zsh/dot-zshrc.d/10-workspace.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zsh/dot-zshrc.d/10-workspace.sh b/zsh/dot-zshrc.d/10-workspace.sh index 5cd9731..5612083 100644 --- a/zsh/dot-zshrc.d/10-workspace.sh +++ b/zsh/dot-zshrc.d/10-workspace.sh @@ -39,15 +39,15 @@ function clone() { local url="$1" local forge owner repo - if [[ "${url}" =~ ^ssh:\/\/[a-zA-Z0-9_]+@([a-zA-Z0-9_.]+):[0-9]+/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(.git)?$ ]]; then + if [[ "${url}" =~ ^ssh:\/\/[a-zA-Z0-9_\-]+@([a-zA-Z0-9_.\-]+):[0-9]+/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)(.git)?$ ]]; then forge="${match[1]:l}" owner="${match[2]:l}" repo="${match[3]:l}" - elif [[ "${url}" =~ ^[a-zA-Z0-9_]+@([a-zA-Z0-9_.]+):([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)(.git)?$ ]]; then + elif [[ "${url}" =~ ^[a-zA-Z0-9_\-]+@([a-zA-Z0-9_.\-]+):([a-zA-Z0-9_\-]+)\/([a-zA-Z0-9_\-]+)(.git)?$ ]]; then forge="${match[1]:l}" owner="${match[2]:l}" repo="${match[3]:l}" - elif [[ "${url}" =~ ^https?:\/\/([a-zA-Z0-9_.]+)(:[0-9]+)?\/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(.git)?$ ]]; then + elif [[ "${url}" =~ ^https?:\/\/([a-zA-Z0-9_.\-]+)(:[0-9]+)?\/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)(.git)?$ ]]; then forge="${match[1]:l}" owner="${match[3]:l}" repo="${match[4]:l}"