diff --git a/installer.lua b/installer.lua index 05a7b40..ee23fbd 100644 --- a/installer.lua +++ b/installer.lua @@ -1,6 +1,6 @@ --[[ /gitget GitHub downloading utility for CC. -Developed by apemanzilla. +Developed by apemanzilla. Modified by ajh123-development This requires ElvishJerricco's JSON parsing API. Direct link: http://pastebin.com/raw.php?i=4nRg9CHU @@ -14,7 +14,10 @@ local async = true -- Whether to write to the terminal as files are downloaded -- Note that unless checked for this will not affect pre-set start/done code below local silent = false - + +local myPath = shell.dir() +shell.setPath("/") + local preset = { -- The GitHub account name user = "ajh123-development", @@ -25,17 +28,18 @@ local preset = { branch = "main", -- The local folder to save all the files to (defaults to '/') - path = "/IPvCC", + path = "IPvCC", -- Function to run before starting the download start = function() if not silent then print("Downloading IPvCC setup...") end - fs.delete("/IPvCC") + fs.delete("IPvCC") end, -- Function to run when the download completes done = function() - shell.run("/IPvCC/setup/main.lua") + shell.run("IPvCC/setup/main.lua") + shell.setPath(myPath) end } diff --git a/setup/main.lua b/setup/main.lua index 3b3eb6f..07ba4c1 100644 --- a/setup/main.lua +++ b/setup/main.lua @@ -1,11 +1,11 @@ -fs.delete("/tmp/IPvCC/") +fs.delete("tmp/IPvCC/") print("Packaging directories...") -fs.makeDir("/IPvCC_programs") +fs.makeDir("IPvCC_programs") -fs.move("/IPvCC/ifconfig.lua", "/IPvCC_programs/ifconfig.lua") -fs.move("/IPvCC/testSend.lua", "/IPvCC_programs/testSend.lua") -fs.move("/IPvCC/testRecv.lua", "/IPvCC_programs/testRecv.lua") +fs.move("IPvCC/ifconfig.lua", "IPvCC_programs/ifconfig.lua") +fs.move("IPvCC/testSend.lua", "IPvCC_programs/testSend.lua") +fs.move("IPvCC/testRecv.lua", "IPvCC_programs/testRecv.lua") -fs.move("/IPvCC/IPvCC", "/IPvCC") +fs.move("IPvCC/IPvCC", "IPvCC") print("Finished installing IPvCC") \ No newline at end of file