extend cl to allow repo name instead of just url

This commit is contained in:
jc 2024-07-17 18:31:37 -04:00
commit 0bfd408974
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View file

@ -146,6 +146,10 @@ cl() {
elif [[ $url =~ https://github\.com/([^/]+)/([^/]+)\.git ]]; then
local project_name="${BASH_REMATCH[1]}"
local repository_name="${BASH_REMATCH[2]}"
elif [[ $# -ne 0 ]]; then
local project_name="juancwu"
local repository_name="$url"
local url="git@github.com:juancwu/$repository_name.git"
else
echo -e "$ERROR Invalid URL format"
return 1