aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/fs.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-08-15 01:54:41 +0200
committerWilliam Boman <william@redwill.se>2021-08-15 02:00:47 +0200
commite4a2926712e1f682f869bf9e89e2de54d0c5d47f (patch)
tree5b6e0cd04a5aaf8c35b1f4f0e51f36b493ec63be /lua/nvim-lsp-installer/fs.lua
parentstylua (diff)
downloadmason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.tar
mason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.tar.gz
mason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.tar.bz2
mason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.tar.lz
mason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.tar.xz
mason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.tar.zst
mason-e4a2926712e1f682f869bf9e89e2de54d0c5d47f.zip
fs: use native vim.fns
Diffstat (limited to 'lua/nvim-lsp-installer/fs.lua')
-rw-r--r--lua/nvim-lsp-installer/fs.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/lua/nvim-lsp-installer/fs.lua b/lua/nvim-lsp-installer/fs.lua
index d9c4ac93..55809767 100644
--- a/lua/nvim-lsp-installer/fs.lua
+++ b/lua/nvim-lsp-installer/fs.lua
@@ -2,8 +2,8 @@ local uv = vim.loop
local M = {}
function M.mkdirp(path)
- if os.execute(("mkdir -p %q"):format(path)) ~= 0 then
- error(("mkdirp: Could not create directory %q"):format(path))
+ if vim.fn.mkdir(path, "p") ~= 1 then
+ error(("mkdirp: Could not create directory %q."):format(path))
end
end
@@ -29,9 +29,8 @@ function M.fstat(path)
end
function M.rmrf(path)
- -- giggity
- if os.execute(("rm -rf %q"):format(path)) ~= 0 then
- error(("rmrf: Could not remove directory %q"):format(path))
+ if vim.fn.delete(path, "rf") ~= 0 then
+ error(("rmrf: Could not remove directory %q."):format(path))
end
end