Skip to content

Commit

Permalink
fix(healthcheck): use correct os name for windows & OS-agnostic appro…
Browse files Browse the repository at this point in the history
…ach to get commit sha

inspired by wallpants/github-preview.nvim#375
  • Loading branch information
wallpants committed May 5, 2024
1 parent 1edb9a0 commit f6168c9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lua/ghost-text/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local M = {}
local function check_platform()
local function get_platform()
local os_name = vim.loop.os_uname().sysname
if os_name == "Windows" then
if os_name == "Windows_NT" then
return "win"
elseif os_name == "Darwin" then
local arch = vim.fn.system("arch")
Expand Down Expand Up @@ -59,8 +59,7 @@ local function check_bun_version()
end

local function check_current_commit_hash()
local result =
run_command("git -C $(dirname " .. vim.fn.shellescape(vim.fn.expand("%:p")) .. ") rev-parse --short HEAD")
local result = run_command("git -C " .. debug.getinfo(1).source:sub(2):match("(.*/)") .. " rev-parse --short HEAD")
if result == nil then
vim.health.error("failed to read git-commit hash")
else
Expand Down

0 comments on commit f6168c9

Please sign in to comment.