aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/fs.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-11-29 10:53:31 +0100
committerGitHub <noreply@github.com>2021-11-29 10:53:31 +0100
commita5168bbf4cc5871ee75f3c5ce779604279fad352 (patch)
tree4a4e654e7e2ce8fed9cc6d24950aa7deb19b5f4b /lua/nvim-lsp-installer/fs.lua
parentadd csharpls (#294) (diff)
downloadmason-a5168bbf4cc5871ee75f3c5ce779604279fad352.tar
mason-a5168bbf4cc5871ee75f3c5ce779604279fad352.tar.gz
mason-a5168bbf4cc5871ee75f3c5ce779604279fad352.tar.bz2
mason-a5168bbf4cc5871ee75f3c5ce779604279fad352.tar.lz
mason-a5168bbf4cc5871ee75f3c5ce779604279fad352.tar.xz
mason-a5168bbf4cc5871ee75f3c5ce779604279fad352.tar.zst
mason-a5168bbf4cc5871ee75f3c5ce779604279fad352.zip
installers/npm: use global style (#289)
Diffstat (limited to 'lua/nvim-lsp-installer/fs.lua')
-rw-r--r--lua/nvim-lsp-installer/fs.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/fs.lua b/lua/nvim-lsp-installer/fs.lua
index b6dce79d..38ac053f 100644
--- a/lua/nvim-lsp-installer/fs.lua
+++ b/lua/nvim-lsp-installer/fs.lua
@@ -101,6 +101,14 @@ function M.write_file(path, contents)
assert(uv.fs_close(fd))
end
+function M.append_file(path, contents)
+ log.fmt_debug("fs: append_file %s", path)
+ assert_ownership(path)
+ local fd = assert(uv.fs_open(path, "a", 438))
+ uv.fs_write(fd, contents, -1)
+ assert(uv.fs_close(fd))
+end
+
---@alias ReaddirEntry {name: string, type: string}
---@param path string @The full path to the directory to read.