From ed42dcf810f4cf3092e9b489e604131eb44994cd Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 17 May 2021 16:51:05 +0200 Subject: use string.format directly --- lua/nvim-lsp-installer/fs.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lua') diff --git a/lua/nvim-lsp-installer/fs.lua b/lua/nvim-lsp-installer/fs.lua index 31bc4044..6277921b 100644 --- a/lua/nvim-lsp-installer/fs.lua +++ b/lua/nvim-lsp-installer/fs.lua @@ -1,12 +1,8 @@ local uv = vim.loop local M = {} -local function escape_quotes(str) - return string.format("%q", str) -end - function M.mkdirp(path) - if os.execute("mkdir -p " .. escape_quotes(path)) ~= 0 then + if os.execute(("mkdir -p %q"):format(path)) ~= 0 then error(("mkdirp: Could not create directory %s"):format(path)) end end @@ -34,7 +30,7 @@ end function M.rmrf(path) -- giggity - if os.execute("rm -rf " .. escape_quotes(path)) ~= 0 then + if os.execute(("rm -rf %q"):format(path)) ~= 0 then error(("Could not remove LSP server directory %s"):format(path)) end end -- cgit v1.2.3-70-g09d2