juansalvatore / git-dashboard-nvim

Your git contributions heatmap chart inside your favorite nvim dashboards.
MIT License
49 stars 3 forks source link

fix(git): handle non-unix stderr redirection #4

Closed scottmckendry closed 3 months ago

scottmckendry commented 3 months ago

This PR is specifically for the Windows crowd.

ArrestedDevelopmentDavidCrossGIF

I tried running this plugin on my Windows machine and was getting a blank ASCII. After some head-scratching, I was able to determine this was due to the Unix-style stderr redirection on a couple of the functions in the git.lua file.

I've fixed this by adding two new local variables and using the built-in vim.fn.has API to determine the correct output.

noahlias commented 3 months ago

The vim.fn.has() return 0|1not boolean, this works on windows but not on unix it will generate a NUL file always

It should be modifed.

local is_windows = vim.fn.has("win32") ==1