41 lines
813 B
Lua
Executable file
41 lines
813 B
Lua
Executable file
#!/usr/bin/lua
|
|
|
|
function write(message)
|
|
stdout = io.open("/dev/stdout", "w")
|
|
stdout:write(message)
|
|
io.close(stdout)
|
|
end
|
|
|
|
print("Building pack...")
|
|
os.execute("cargo build --release")
|
|
os.execute("cp target/release/pack .")
|
|
print("Done!\n\n")
|
|
|
|
write("Setup environment? (requires root) [Y/n]: ")
|
|
input = io.read()
|
|
if input ~= "n" then
|
|
os.execute("scripts/setup.sh")
|
|
else
|
|
print("Goodbye!\n")
|
|
end
|
|
|
|
print()
|
|
|
|
write("Setup default evironment? [Y/n]: ")
|
|
input = io.read()
|
|
if input ~= "n" then
|
|
os.execute("scripts/mkenv.sh arch_core")
|
|
end
|
|
|
|
print()
|
|
|
|
write("Add /usr/pack/bin/ to path? [Y/n]: ")
|
|
input = io.read()
|
|
if input ~= "n" then
|
|
write("Enter the name of the file to append to (full path): ")
|
|
file = io.read()
|
|
f = io.open(file, "a")
|
|
f:write("export PATH=$PATH:/usr/pack/bin\n")
|
|
else
|
|
print("Goodbye!\n")
|
|
end
|