Created
June 30, 2015 22:42
-
-
Save aesnyder/7d692b85a51719896237 to your computer and use it in GitHub Desktop.
Circle CI status in vim-airline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:circle_last_update = localtime() | |
let g:circle_update_frequencey_in_seconds = 30 | |
function! UpdateCirlceStatus() | |
let output = system('circle status') | |
if v:shell_error | |
let g:circle_last_status = 'fail' | |
else | |
let g:circle_last_status = 'pass' | |
endif | |
return g:circle_last_status | |
endfunction | |
let g:circle_last_status = UpdateCirlceStatus() | |
function! CircleStatus() | |
let current_time = localtime() | |
if current_time - g:circle_last_update > g:circle_update_frequencey_in_seconds | |
let g:circle_last_update = current_time | |
echo "Checking CI" | |
call UpdateCirlceStatus() | |
endif | |
return g:circle_last_status | |
endfunction | |
let g:airline_section_b = "%{CircleStatus()}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
depends upon: https://github.com/aesnyder/circle-cli