Improved build script

This commit is contained in:
Skye Bleed 2019-09-05 19:12:03 -05:00
parent b2c7f9b2fd
commit 7e4f8c5da7

View file

@ -1,13 +1,17 @@
#!/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")
stdo = io.open("/dev/stdout", "w")
stdo:write("Setup environment? (requires root) [Y/n]: ")
io.close(stdo)
write("Setup environment? (requires root) [Y/n]: ")
input = io.read()
if input ~= "n" then
os.execute("scripts/setup.sh")
@ -17,10 +21,18 @@ end
print()
print("Add /usr/pack/bin/ to path? [Y/n]:")
write("Setup default evironment? [Y/n]: ")
input = io.read()
if input ~= "n" then
print("Enter the name of the file to append to (full path):")
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")