From 7e4f8c5da7f2e359f0647a28588f88405d32120c Mon Sep 17 00:00:00 2001 From: Skye Bleed Date: Thu, 5 Sep 2019 19:12:03 -0500 Subject: [PATCH] Improved build script --- scripts/build | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/build b/scripts/build index 7541627..1d38d34 100755 --- a/scripts/build +++ b/scripts/build @@ -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")