Skip to content

Commit

Permalink
fix: win32 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Robitx committed Aug 1, 2024
1 parent d5fcd00 commit 6d0f1b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/gp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ end
M.not_chat = function(buf, file_name)
file_name = vim.fn.resolve(file_name)
local chat_dir = vim.fn.resolve(M.config.chat_dir)
if vim.fn.has("win32") then
if vim.fn.has("win32") == 1 then
file_name = file_name:gsub("\\", "/")
chat_dir = chat_dir:gsub("\\", "/")
end
Expand Down Expand Up @@ -527,7 +527,7 @@ M.prep_chat = function(buf, file_name)

-- make last.md a symlink to the last opened chat file
local last = M.config.chat_dir .. "/last.md"
if file_name ~= last and vim.fn.has("win32") then
if file_name ~= last and vim.fn.has("win32") == 1 then
os.execute("pwsh -Noprofile -c New-Item -Force -ItemType SymbolicLink -Path " .. last .. " -Target " .. file_name)
elseif file_name ~= last then
os.execute("ln -sf " .. file_name .. " " .. last)
Expand Down

0 comments on commit 6d0f1b5

Please sign in to comment.