Skip to content

Commit

Permalink
Merge pull request #150 from wakatime/feature/api-key-vault-cmd
Browse files Browse the repository at this point in the history
Support reading api-key from vault command
  • Loading branch information
alanhamlett authored Nov 25, 2022
2 parents 4692ec3 + 8db1787 commit a2c0e31
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugin/wakatime.vim
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,16 @@ EOF
if s:GetIniSetting('settings', 'api_key') != '' || s:GetIniSetting('settings', 'apikey') != ''
let found_api_key = s:true
endif

if !found_api_key
let vault_cmd = s:GetIniSetting('settings', 'api_key_vault_cmd')
if !empty(vault_cmd)
if s:Chomp(system(vault_cmd)) != ''
let found_api_key = s:true
endif
endif
endif

if !found_api_key
call s:PromptForApiKey()
echo "[WakaTime] Setup complete! Visit https://wakatime.com to view your coding activity."
Expand Down

0 comments on commit a2c0e31

Please sign in to comment.