From b88a57449597c98427b185c53877ed6179d15eef Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Fri, 17 Jul 2020 14:54:47 +0200 Subject: [PATCH] feature: fn(x) for forking repos via github --- dot_zsh_functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dot_zsh_functions b/dot_zsh_functions index 84b68d5..142d706 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -483,9 +483,15 @@ function clone() { error "unable to change current directory to : $folder" fi else - error "unable to clone repository url : $1" + error "unable to clone repository from url : $1" fi } +function fork() { + # FIXME : go to local copy of the repo after the fork + code + local folder=$(basename $1 | sed 's/\.git.*//g') + gh repo fork "$1" +} function git-project() { if [ -d "$REPO_PATH" ]; then REPO_PATH="$(pwd)"