prompting user for api key if config file does not exist
This commit is contained in:
parent
4dd3b4b8d2
commit
cbb5a9fa14
1 changed files with 9 additions and 0 deletions
|
@ -46,6 +46,15 @@ let s:VERSION = '0.2.1'
|
||||||
exec "silent !mv" expand("$HOME/.wakatime") expand("$HOME/.wakatime.conf")
|
exec "silent !mv" expand("$HOME/.wakatime") expand("$HOME/.wakatime.conf")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Create config file if does not exist
|
||||||
|
if !filereadable(expand("$HOME/.wakatime.conf"))
|
||||||
|
let key = input("Enter your WakaTi.me api key: ")
|
||||||
|
if key != ''
|
||||||
|
call writefile([printf("api_key=%s", key)], expand("$HOME/.wakatime.conf"))
|
||||||
|
echo "WakaTi.me setup complete! Visit https://wakati.me to view your logged time."
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" Globals
|
" Globals
|
||||||
let s:plugin_directory = expand("<sfile>:p:h") . '/'
|
let s:plugin_directory = expand("<sfile>:p:h") . '/'
|
||||||
let s:last_action = 0
|
let s:last_action = 0
|
||||||
|
|
Loading…
Reference in a new issue