Skip to content

Commit

Permalink
Find executable files in $PATH
Browse files Browse the repository at this point in the history
Homebrew
macOS Intel: /usr/local/bin
macOS ARM: /opt/homebrew/bin
Linux: /home/linuxbrew/.linuxbrew/bin
   or: ~/.linuxbrew/bin
  • Loading branch information
moeshin committed Dec 25, 2021
1 parent d690e8f commit 7fcdd67
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plugin/wakatime.vim
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ let s:VERSION = '9.0.1'
let path = path . '.exe'
endif

" Check for wakatime-cli installed via Homebrew
if !filereadable(path) && filereadable('/usr/local/bin/wakatime-cli')
let s:wakatime_cli = '/usr/local/bin/wakatime-cli'
" Check for wakatime-cli
if !filereadable(path) && executable('wakatime-cli')
let s:wakatime_cli = 'wakatime-cli'

" Check for wakatime binary in /usr/bin
elseif !filereadable(path) && filereadable('/usr/bin/wakatime')
let s:wakatime_cli = '/usr/bin/wakatime'
" Check for wakatime
elseif !filereadable(path) && executable('wakatime')
let s:wakatime_cli = 'wakatime'

" Default to ~/.wakatime/wakatime-cli-<os>-<arch>
else
Expand All @@ -144,7 +144,7 @@ let s:VERSION = '9.0.1'
endfunction

function! s:InstallCLI(use_external_python)
if !s:autoupdate_cli && filereadable(s:wakatime_cli)
if !s:autoupdate_cli && executable(s:wakatime_cli)
return
endif

Expand Down

0 comments on commit 7fcdd67

Please sign in to comment.