-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscm.lua
More file actions
43 lines (35 loc) · 1.17 KB
/
scm.lua
File metadata and controls
43 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---@class SCM
SCM = {}
require('./libs.scm.config')
require('./libs.scm.net')
require('./libs.scm.log')
require('./libs.scm.scriptManager')
require('./libs.scm.autocomplete')
require('./libs.scm.ui')
function SCM:checkVersion()
if not self.Config.config["updateAvailable"] and self.Config.config["lastVersionCheck"] ~= '' .. os.day("utc") then
local success, newestVersion = self.Net:getNewestVersion()
if success and newestVersion ~= self.Config.config["currentVersion"] then
self.Config.config["updateAvailable"] = true
end
self.Config.config["lastVersionCheck"] = os.day("utc") .. ''
self.Config:saveConfig()
end
end
function SCM:init()
if not fs.exists(self.Config.config["configDirectory"]) then
fs.makeDir(self.Config.config["configDirectory"])
end
if not fs.exists(self.Config.config["libraryDirectory"]) then
fs.makeDir(self.Config.config["libraryDirectory"])
end
self.Config:loadConfig()
self.ScriptManager:loadScripts()
self:checkVersion()
end
function SCM:load(...)
return SCM.ScriptManager:load(...)
end
SCM:init()
SCM.Autocomplete:handleArguments({ ... })
return SCM