File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,24 @@ function installer.download(url, file)
130130 end
131131end
132132
133+ local basaltDataCache
134+ function installer .getBasaltData ()
135+ if (basaltDataCache ~= nil )then return basaltDataCache end
136+ local content
137+ printStatus (" Downloading basalt data..." )
138+ if (fs .exists (" basaltdata.json" ))then
139+ content = fs .open (" basaltdata.json" , " r" )
140+ else
141+ content = installer .get (" https://basalt.madefor.cc/basaltdata.json" )
142+ end
143+ if (content ~= nil )then
144+ content = content .readAll ()
145+ basaltDataCache = textutils .unserializeJSON (content )
146+ printStatus (" Successfully downloaded basalt data!" )
147+ return basaltDataCache
148+ end
149+ end
150+
133151function installer .getRelease (version )
134152 local v = installer .getBasaltData ().versions [version ]
135153 if (v ~= nil )then
You can’t perform that action at this time.
0 commit comments