iteration
This commit is contained in:
		@ -1,6 +1,7 @@
 | 
			
		||||
local args = { ... }
 | 
			
		||||
 | 
			
		||||
local target_branch = "main"
 | 
			
		||||
local bin_path = "/"
 | 
			
		||||
 | 
			
		||||
local program_name = args[1]
 | 
			
		||||
if program_name == nil then
 | 
			
		||||
@ -14,11 +15,15 @@ io.write("Updating " .. program_name .. ".lua\n")
 | 
			
		||||
 | 
			
		||||
if response.getResponseCode() == 200 then
 | 
			
		||||
 | 
			
		||||
    file = fs.open(program_name .. ".lua", "w")
 | 
			
		||||
    file = fs.open(bin_path .. program_name .. ".lua", "w")
 | 
			
		||||
    file.write(response.readAll())
 | 
			
		||||
    file.close()
 | 
			
		||||
 | 
			
		||||
    fs.move(program_name .. ".lua", "/rom/programs/" .. program_name .. ".lua")
 | 
			
		||||
    -- check if program is in path
 | 
			
		||||
    if not shell.resolveProgram(program_name) then
 | 
			
		||||
        print("Program not in path, adding to path")
 | 
			
		||||
        shell.setPath(shell.path() .. ":" .. bin_path)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    print("Updated " .. program_name .. ".lua")
 | 
			
		||||
else
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user