diff --git a/lupdate.lua b/lupdate.lua index 4459d08..319b247 100644 --- a/lupdate.lua +++ b/lupdate.lua @@ -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