-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preset ignore intellisense.lua if it's missing
- Loading branch information
1 parent
8d9c919
commit f7ae769
Showing
2 changed files
with
49 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
local lfs = require "lfs" | ||
local AvPath = require "avpath" | ||
|
||
local Utils = require "SelenScript.utils" | ||
|
||
|
||
local PRESETS_PATH = AvPath.join{require "tool.tool_path", "presets"} | ||
|
||
local PresetsUtils = {} | ||
PresetsUtils.PRESETS_PATH = PRESETS_PATH | ||
|
||
|
||
---@param path string | ||
---@param binary boolean? | ||
function PresetsUtils.read_file(path, binary) | ||
path = AvPath.join{PRESETS_PATH, path} | ||
return Utils.readFile(path, binary) | ||
end | ||
|
||
---@param path string | ||
---@param data string | ||
---@param binary boolean? | ||
function PresetsUtils.write_file(path, data, binary) | ||
path = AvPath.join{PRESETS_PATH, path} | ||
lfs.mkdir(AvPath.base(path)) | ||
Utils.writeFile(path, data, binary) | ||
end | ||
|
||
|
||
local lfs = require "lfs" | ||
local AvPath = require "avpath" | ||
|
||
local Utils = require "SelenScript.utils" | ||
|
||
|
||
local PRESETS_PATH = AvPath.join{require "tool.tool_path", "presets"} | ||
|
||
local PresetsUtils = {} | ||
PresetsUtils.PRESETS_PATH = PRESETS_PATH | ||
|
||
|
||
---@param path string | ||
function PresetsUtils.exists(path) | ||
path = AvPath.join{PRESETS_PATH, path} | ||
return AvPath.exists(path) | ||
end | ||
|
||
|
||
---@param path string | ||
---@param binary boolean? | ||
function PresetsUtils.read_file(path, binary) | ||
path = AvPath.join{PRESETS_PATH, path} | ||
return Utils.readFile(path, binary) | ||
end | ||
|
||
---@param path string | ||
---@param data string | ||
---@param binary boolean? | ||
function PresetsUtils.write_file(path, data, binary) | ||
path = AvPath.join{PRESETS_PATH, path} | ||
lfs.mkdir(AvPath.base(path)) | ||
Utils.writeFile(path, data, binary) | ||
end | ||
|
||
|
||
return PresetsUtils |