aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lua/mason-scripts/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lua/mason-scripts/utils.lua')
-rw-r--r--scripts/lua/mason-scripts/utils.lua40
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/lua/mason-scripts/utils.lua b/scripts/lua/mason-scripts/utils.lua
deleted file mode 100644
index ee6ab10..0000000
--- a/scripts/lua/mason-scripts/utils.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-local _ = require "mason-core.functional"
-local fs = require "mason-core.fs"
-
-local M = {}
-
----@async
----@param path string
----@param contents string
----@param flags string?
-function M.write_file(path, contents, flags)
- local header = _.cond({
- {
- _.matches "%.lua$",
- _.always {
- "-- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY.",
- "-- stylua: ignore start",
- },
- },
- {
- _.matches "%.md$",
- _.always {
- "<!--- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY. -->",
- },
- },
- {
- _.matches "doc/.+%.txt$",
- _.always {},
- },
- {
- _.T,
- _.always {
- "# THIS FILE IS GENERATED. DO NOT EDIT MANUALLY.",
- },
- },
- }, path)
-
- fs.async.write_file(path, table.concat(_.concat(header, { contents }), "\n"), flags)
-end
-
-return M