pack/scripts/build

42 lines
813 B
Plaintext
Raw Permalink Normal View History

2019-09-03 21:47:27 +00:00
#!/usr/bin/lua
2019-09-06 00:12:03 +00:00
function write(message)
stdout = io.open("/dev/stdout", "w")
stdout:write(message)
io.close(stdout)
end
2019-09-03 21:47:27 +00:00
print("Building pack...")
os.execute("cargo build --release")
os.execute("cp target/release/pack .")
print("Done!\n\n")
2019-09-06 00:12:03 +00:00
write("Setup environment? (requires root) [Y/n]: ")
2019-09-03 21:47:27 +00:00
input = io.read()
2019-09-04 23:04:18 +00:00
if input ~= "n" then
2019-09-03 21:47:27 +00:00
os.execute("scripts/setup.sh")
else
print("Goodbye!\n")
end
2019-09-04 23:04:18 +00:00
print()
2019-09-06 00:12:03 +00:00
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]: ")
2019-09-04 23:04:18 +00:00
input = io.read()
if input ~= "n" then
2019-09-06 00:12:03 +00:00
write("Enter the name of the file to append to (full path): ")
2019-09-04 23:04:18 +00:00
file = io.read()
f = io.open(file, "a")
f:write("export PATH=$PATH:/usr/pack/bin\n")
else
print("Goodbye!\n")
end