Skip to content

Commit

Permalink
UPDATED: GIT Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
axljuega committed Nov 28, 2023
1 parent bfc89f2 commit 59967c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion data/features/clone/clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

clone()
{
my_host="github.com"
if [ $# -eq 0 ]; then
echo "ERROR: You need to provide at least one argument"
return
else
if [ -n "$(echo "$1" | grep -Eo "^http.?://.+$")" ]; then
git clone "$1"
else
elif [ -n "$(echo "$1" | grep -Eo ".+/.+/.+$")" ]; then
git clone "https://$1"
else
git clone "https://${my_host}/$1"
fi
fi
}
Expand Down

0 comments on commit 59967c4

Please sign in to comment.