diff options
| author | William Boman <william@redwill.se> | 2021-05-17 16:51:05 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2021-05-17 16:51:05 +0200 |
| commit | ed42dcf810f4cf3092e9b489e604131eb44994cd (patch) | |
| tree | b098e2c8cd198450f5482c2a89f7d1a7504cf098 /lua/nvim-lsp-installer | |
| parent | zx: compose installer with shell.raw (#16) (diff) | |
| download | mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.tar mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.tar.gz mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.tar.bz2 mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.tar.lz mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.tar.xz mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.tar.zst mason-ed42dcf810f4cf3092e9b489e604131eb44994cd.zip | |
use string.format directly
Diffstat (limited to 'lua/nvim-lsp-installer')
| -rw-r--r-- | lua/nvim-lsp-installer/fs.lua | 8 |
1 files changed, 2 insertions, 6 deletions
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 |
