Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

"CMake configure" raises error on windows #13

Closed
spindensity opened this issue Oct 13, 2021 · 6 comments
Closed

"CMake configure" raises error on windows #13

spindensity opened this issue Oct 13, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@spindensity
Copy link

Bug description
Execute :CMake configure, an error is raised:

Snipaste_2021-10-13_22-29-32

Steps to reproduce

  1. Open any fresh cmake project without build directory on windows with neovim;
  2. Execute :CMake configure.

Expected behavior

No errors occur.

Actual behavior

An error is raised:

Snipaste_2021-10-13_22-29-32

Additional context

mkdir function in plenary.nvim splits path with plenary.path.path.sep to determine the parent directories, the value of plenary.path.path.sep is \ on windows. neovim-cmake hardcode the path separator as /, so mkdir fails to determine the parent parts of the path, and raises the error.

@spindensity spindensity added the bug Something isn't working label Oct 13, 2021
@Shatur
Copy link
Owner

Shatur commented Oct 13, 2021

@spindensity Could you check if #14 fixes the issue for you?

@spindensity
Copy link
Author

No, the following code segments need to be changed also:

function utils.get_reply_dir(build_dir)
return build_dir / '.cmake/api/v1/reply'
end

local query_dir = build_dir / '.cmake/api/v1/query'
if not query_dir:mkdir({ parents = true }) then
utils.notify('Unable to create folder ' .. query_dir.filename, vim.log.levels.ERROR)
return false
end

@Shatur
Copy link
Owner

Shatur commented Oct 13, 2021

@spindensity Nice catch, fixed. Could you check it again?

@spindensity
Copy link
Author

I can confirm 2cfda5e fixed the problem.

Thanks.

@Shatur
Copy link
Owner

Shatur commented Oct 14, 2021

Thank you!

@Shatur
Copy link
Owner

Shatur commented Oct 14, 2021

Closed by #14.

@Shatur Shatur closed this as completed Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants