@@ -177,55 +177,6 @@ $ help <name>
177177 self .commands [" help" ][" args" ] = availableCommands
178178 end
179179
180- function Autocomplete :refreshRepoScripts ()
181- log (" Downloading program and library names from GitHub..." )
182- local repoScripts = {}
183-
184- local programs = {}
185- local libraries = {}
186-
187- local request = http .get (SCM .Config .getAll (SCM .Config )[" apiGithubURL" ]
188- .. SCM .Config .getAll (SCM .Config )[" user" ]
189- .. SCM .Config .getAll (SCM .Config )[" apiGithubGetRepos" ])
190- if request then
191- local response = request .readAll ()
192- request .close ()
193-
194- local responseTable = textutils .unserializeJSON (response )
195-
196- local programSuffix = SCM .Config .getAll (SCM .Config )[" programSuffix" ]
197- local librarySuffix = SCM .Config .getAll (SCM .Config )[" librarySuffix" ]
198-
199- for i = 1 , # responseTable , 1 do
200- local scriptName = responseTable [i ][" name" ]
201- if string.sub (scriptName , - string.len (programSuffix )) == programSuffix then
202- programs [
203- string.sub (scriptName , 0 , string.len (scriptName ) - string.len (programSuffix ))
204- ] = {}
205- elseif string.sub (scriptName , - string.len (librarySuffix )) == librarySuffix then
206- libraries [
207- string.sub (scriptName , 0 , string.len (scriptName ) - string.len (librarySuffix ))
208- ] = {}
209- end
210- end
211- else
212- log (" Download failed" )
213- end
214-
215- self .commands [" add" ][" args" ] = programs
216- self .commands [" require" ][" args" ] = libraries
217-
218- repoScripts [" libraries" ] = libraries
219- repoScripts [" programs" ] = programs
220-
221- local file = fs .open (SCM .Config .getAll (SCM .Config )[" configDirectory" ]
222- .. SCM .Config .getAll (SCM .Config )[" repoScriptsFile" ], " w" )
223- if file then
224- file .write (textutils .serializeJSON (repoScripts ))
225- file .close ()
226- end
227- end
228-
229180 --- @param shell table
230181 --- @param index integer
231182 --- @param argument string
@@ -260,13 +211,13 @@ $ help <name>
260211 end
261212
262213 function Autocomplete :refreshAutocomplete ()
263- self :refreshRepoScripts ()
214+ SCM . Net :refreshRepoScripts ()
264215 self :prepareAutocomplete ()
265216 self :updateAutocomplete ()
266217 end
267218
268219 --- @param t table
269- function Autocomplete :setProgramms (t )
220+ function Autocomplete :setPrograms (t )
270221 self .commands [" add" ][" args" ] = t
271222 end
272223
0 commit comments