(bash) fix unintentional setting url to blank

this is related to the clone repo function
This commit is contained in:
jc 2024-10-15 18:42:22 -04:00
commit dfe6245aaa

View file

@ -145,10 +145,8 @@ fcd() {
cl() {
local url=$1
local ghq_dir="$HOME/ghq"
local argc=$#
local project_name=""
local repository_name=""
local url=""
# extract project name
if [[ $url =~ git@git(lab|hub)\.com:([^/]+)/([^/]+)\.git ]]; then
@ -175,7 +173,6 @@ cl() {
# check if directory for project exists or not
local project_dir="${ghq_dir}/${namespace}/${repository_name}"
echo $project_dir
if [[ ! -d $project_dir ]]; then
mkdir -p $project_dir
fi