From 441f418164e939c730b00919a0f8ac8262abf698 Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Wed, 20 Jul 2022 05:31:39 -0700 Subject: [PATCH] :technologist: Copies github PAT to clipboard for git init script --- scripts/bgit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/bgit b/scripts/bgit index 9a5f737e..d5602a57 100755 --- a/scripts/bgit +++ b/scripts/bgit @@ -144,13 +144,16 @@ if [ $numrepos -eq 0 ] ; then if [[ -n $repo ]] ; then if [[ -n $host && $host="github.com" ]] ; then - echo "Host Site is github.com, creating repository..." + echo "${txtgreen}Host Site is github.com, creating repository...${txtwhite}" source $HOME/.gh_pat curl -u $uname:$GH_TOKEN https://api.github.com/user/repos -d '{"name": "'${repo}'"}' + echo -e "${txtgreen}Your \$GH_TOKEN is saved to your clipboard\nSimply enter CTRL+SHIFT+V to paste your token\nWhen prompted for your password${txtwhite}" + echo $GH_TOKEN | xclip -sel clip fi git remote add $remote "https://$host/$uname/$repo" git push -u $remote $branch + echo '' | xclip && xclip -selection clipboard /dev/null if [[ $host="github.com" ]] ; then echo "${txtgreen}Git repository created and initiated!!${txtwhite}"