diff options
-rw-r--r-- | plugins/ghmarkdown.lua | 7 | ||||
-rw-r--r-- | plugins/gitstatus.lua | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/plugins/ghmarkdown.lua b/plugins/ghmarkdown.lua index b49e248..0f49c02 100644 --- a/plugins/ghmarkdown.lua +++ b/plugins/ghmarkdown.lua @@ -50,17 +50,16 @@ command.add("core.docview", { content = content:gsub(".", esc) }) - local htmlfile = ".lite_ghmarkdown_" .. os.tmpname():gsub("%W", "") .. ".html" + local htmlfile = core.temp_filename(".html") local fp = io.open(htmlfile, "w") fp:write(text) fp:close() core.log("Opening markdown preview for \"%s\"", dv:get_name()) - local path = system.absolute_path(".") .. "/" .. htmlfile if PLATFORM == "Windows" then - system.exec("start " .. path) + system.exec("start " .. htmlfile) else - system.exec(string.format("xdg-open %q", path)) + system.exec(string.format("xdg-open %q", htmlfile)) end core.add_thread(function() diff --git a/plugins/gitstatus.lua b/plugins/gitstatus.lua index a9db50b..a58fd0f 100644 --- a/plugins/gitstatus.lua +++ b/plugins/gitstatus.lua @@ -11,10 +11,9 @@ local git = { } -local tempfile = ".lite_gitstatus_" .. os.tmpname():gsub("%W", "") - local function exec(cmd, wait) - system.exec(cmd .. " >" .. tempfile) + local tempfile = core.temp_filename() + system.exec(string.format("%s > %q", cmd, tempfile)) coroutine.yield(wait) local fp = io.open(tempfile) local res = fp:read("*a") |