Skip to content

Commit

Permalink
#150 couldn't make stderr distinct from stdout (#107)
Browse files Browse the repository at this point in the history
* use lua native calls to create empty file (replace os.exec(touch)

* deal with win paths better

* fix style

* fix quote style

---------

Co-authored-by: Tom Collings <tom.collings@gmail.com>
Co-authored-by: amleto <amleto@not.real.com>
  • Loading branch information
3 people committed Jul 29, 2023
1 parent 565d3a0 commit 8e8e952
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/cmake-tools/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ end
local function get_current_path()
local current_path = vim.loop.cwd()
local clean_path = current_path:gsub("/", "")
clean_path = clean_path:gsub("\\", "")
clean_path = clean_path:gsub(":", "")
return get_cache_path() .. clean_path .. ".lua"
end

Expand All @@ -39,7 +41,10 @@ local function init_session()

local path = get_current_path()
if not utils.file_exists(path) then
os.execute("touch " .. path)
local file = io.open(path, "w")
if file then
file:close()
end
end
end

Expand Down

0 comments on commit 8e8e952

Please sign in to comment.