|
16 | 16 | end |
17 | 17 | local log = function(...) SCM.Log:log(...) end |
18 | 18 |
|
19 | | - ---loads the scripts |
20 | 19 | function ScriptManager:loadScripts() |
21 | 20 | local file = fs.open(config()["configDirectory"] .. config()["scriptFile"], "r") |
22 | 21 | if not file then |
|
30 | 29 | end |
31 | 30 | end |
32 | 31 |
|
33 | | - ---loads all scripts |
34 | 32 | function ScriptManager:saveScripts() |
35 | 33 | local file = fs.open(config()["configDirectory"] .. config()["scriptFile"], "w") |
36 | 34 | if not file then |
|
41 | 39 | file.close() |
42 | 40 | end |
43 | 41 |
|
44 | | - ---adds a script to the script File |
45 | 42 | ---@param script table | nil |
46 | 43 | ---@param success boolean |
47 | 44 | ---@return boolean |
|
107 | 104 | return false |
108 | 105 | end |
109 | 106 |
|
110 | | - --- updates all scripts |
111 | 107 | function ScriptManager:updateAllScripts() |
112 | 108 | for i = 1, #self.scripts, 1 do |
113 | 109 | self:updateScript(self.scripts[i].name, "default") |
114 | 110 | end |
115 | 111 | end |
116 | 112 |
|
117 | | - --- removes a script |
118 | 113 | ---@param name string |
119 | 114 | ---@param keepScriptConfig boolean | nil |
120 | 115 | function ScriptManager:removeScript(name, keepScriptConfig) |
|
133 | 128 | self.scripts = o |
134 | 129 | self:saveScripts() |
135 | 130 | end |
| 131 | + |
136 | 132 | -- delete file |
137 | 133 | local scriptDir = config()[scriptType .. "Directory"] |
138 | 134 | if scriptType and ( |
|
153 | 149 | SCM.Autocomplete:updateAutocomplete() |
154 | 150 | end |
155 | 151 |
|
156 | | - --- removes all scripts |
157 | 152 | function ScriptManager:removeAllScripts() |
158 | 153 | local tmpScripts = {} |
159 | 154 | for i = 1, #self.scripts, 1 do |
|
183 | 178 | file = fs.open("./" .. config()["libraryDirectory"] .. name .. ".lua", "r") |
184 | 179 | end |
185 | 180 | if not file then log('File ' .. name .. ' not found') end |
| 181 | + |
186 | 182 | -- Find requirements by searching for comment --@requires name |
187 | 183 | local requires = {} |
188 | 184 | while true do |
|
0 commit comments