-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgithub-cli_setup.sh
More file actions
33 lines (30 loc) · 948 Bytes
/
Copy pathgithub-cli_setup.sh
File metadata and controls
33 lines (30 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#/bin/bash
color() {
echo "\e[38;5;10m$@\e[0m"
}
dot=$( color » )
code=$( color CODE-CODE )
url=https://github.com/login/device
banner gh auth login
echo -e "\
? Where do you use GitHub?
$( color GitHub.com )
? What is your preferred protocol for Git operations on this host?
$( color HTTPS )
? How would you like to authenticate GitHub CLI?
$( color Login with a web browser )
! First copy your one-time code: $code
Press [Enter] to open $url in your browser...
$dot Copy $code > [Enter]
$dot Select user (login if not already)
$dot Paste $code
$dot Authorize
$dot Enter verifying code (by Authenticator app)
$( color ✓ ) Authentication complete.
................................................................................
"
gh auth login
email=$( dialog.input 'GitHub email:' @gmail.com )
user=$( dialog.input 'GitHub username:' )
git config --global user.email $email
git config --global user.name $user