Commit 2ceb8e70 authored by Danny SMc's avatar Danny SMc

Made it workable with cloning the repo directly into your emulator/minecraft...

Made it workable with cloning the repo directly into your emulator/minecraft save folder, and it will build from there. Just start the computer
parent 1f7fe8a6
......@@ -77,15 +77,15 @@ function build(logging)
local ok, err = pcall( function()
if logging then print("Starting build...") end
if not logging then write("Building... ") end
if fs.exists("discoverapp.lua") then
if fs.exists("src/discoverapp.lua") then
if logging then print("Renaming existing build into temp...") end
fs.move("discoverapp.lua", "discoverapp.temp.lua")
fs.move("src/discoverapp.lua", "src/discoverapp.temp.lua")
end
local f = fs.open("discoverapp.lua", "a")
local f = fs.open("src/discoverapp.lua", "a")
for k,v in ipairs(paths) do
if logging then print("Building: " .. tostring(k) .. " / " .. tostring(#paths)) end
sleep(0.01)
local fp = fs.open(v, "r")
local fp = fs.open(fs.combine('src', v), "r")
f.write(fp.readAll())
f.write("\n\n")
fp.close()
......@@ -94,14 +94,14 @@ function build(logging)
print("Success")
end)
if not ok then
fs.delete("discoverapp.lua")
fs.move("discoverapp.temp.lua", "discoverapp.lua")
fs.delete("src/discoverapp.lua")
fs.move("src/discoverapp.temp.lua", "src/discoverapp.lua")
term.setTextColor(colours.red)
if logging then print(shell.getRunningProgram() .. ": " .. tostring(err)) end
term.setTextColor(colours.white)
print("Fail")
else
fs.delete("discoverapp.temp.lua")
fs.delete("src/discoverapp.temp.lua")
end
end
......@@ -115,7 +115,7 @@ if (#tArgs > 0) then
elseif tArgs[1] == "compress" then
if fs.exists("discoverapp.lua") then
write("Compressing... ")
local f = fs.open("discoverapp.lua", "r")
local f = fs.open("src/discoverapp.lua", "r")
local data = f.readAll()
f.close()
......@@ -123,7 +123,7 @@ if (#tArgs > 0) then
data = data:gsub("[\r\f\n]"," ")
data = data:gsub("(%s+)", " ")
local f = fs.open("discoverapp.min.lua", "w")
local f = fs.open("src/discoverapp.min.lua", "w")
f.write(data)
f.close()
print("Success")
......
This diff is collapsed.
shell.run("builder.lua run -l")
shell.run("discoverapp.lua")
print("Build / Run Finished")
\ No newline at end of file
shell.run("src/builder.lua run -l")
shell.run("src/discoverapp.lua")
print("Build / Run Finished")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment