1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 02:05:40 +08:00

fix(curl): use bundle curl instead of windows's

This commit is contained in:
wsdjeg 2022-04-30 20:56:58 +08:00
parent 7b32f1a23d
commit 83fc0188ba

View File

@ -191,7 +191,14 @@ endfunction
function! chat#gitter#send(room, msg) abort
let roomid = s:room_to_roomid(a:room)
let cmd = ['curl', '-X', 'POST', '-H', 'Content-Type: application/json', '-H', 'Accept: application/json',
" the win 11 curl in system32/ directory do not support unicode, use
" neovim's curl
if has('nvim') && exists('v:progpath') && (has('win64') || has('win32'))
let curl = fnamemodify(v:progpath, ':h') . '\curl.exe'
else
let curl = 'curl'
endif
let cmd = [curl, '-X', 'POST', '-H', 'Content-Type: application/json', '-H', 'Accept: application/json',
\ '-H', 'Authorization: Bearer ' . g:chat_gitter_token,
\ printf('https://api.gitter.im/v1/rooms/%s/chatMessages', roomid),
\ '-d',