Add a dash to the allowed characters for clone
This commit is contained in:
parent
2da1d30e9e
commit
4f486821bb
1 changed files with 3 additions and 3 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue