🧑‍💻 Copies github PAT to clipboard for git init script

This commit is contained in:
z3rOR0ne 2022-07-20 05:31:39 -07:00
parent cc170eeacd
commit 441f418164

View file

@ -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}"