mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-06 20:24:29 +08:00
Support password authentication
This commit is contained in:
@@ -38,13 +38,23 @@ function! s:credentials()
|
|||||||
let g:github_user = $LOGNAME
|
let g:github_user = $LOGNAME
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if !exists('g:github_token')
|
if !exists('g:github_password')
|
||||||
|
let g:github_password = $GITHUB_PASSWORD
|
||||||
|
if g:github_password ==# ''
|
||||||
|
let g:github_password = system('git config --get github.password')[0:-2]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if !exists('g:github_token') && g:github_password ==# ''
|
||||||
let g:github_token = $GITHUB_TOKEN
|
let g:github_token = $GITHUB_TOKEN
|
||||||
if g:github_token ==# ''
|
if g:github_token ==# ''
|
||||||
let g:github_token = system('git config --get github.token')[0:-2]
|
let g:github_token = system('git config --get github.token')[0:-2]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
return g:github_user.'/token:'.g:github_token
|
if exists('g:github_token') && g:github_token !=# ''
|
||||||
|
return g:github_user.'/token:'.g:github_token
|
||||||
|
else
|
||||||
|
return g:github_user.':'.g:github_password
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! rhubarb#json_parse(string)
|
function! rhubarb#json_parse(string)
|
||||||
|
|||||||
Reference in New Issue
Block a user