From 0bfd408974217896e972d552daeaaf9ccf832d2a Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:31:37 -0400 Subject: [PATCH] extend cl to allow repo name instead of just url --- bash/.bashrc | 4 ++++ zsh/.zshrc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index 27c5179..dfcdb83 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -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 diff --git a/zsh/.zshrc b/zsh/.zshrc index 0857cf5..57f854a 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -94,6 +94,10 @@ cl() { elif [[ $url =~ https://github\.com/([^/]+)/([^/]+)\.git ]]; then local project_name="${match[1]}" local repository_name="${match[2]}" + elif [[ $# -ne 0 ]]; then + local project_name="juancwu" + local repository_name="$url" + local url="git@github.com:juancwu/$repository_name.git" else echo "Invalid URL format" return 1