Better error handling
This commit is contained in:
parent
39d7554686
commit
adfd5c5300
4 changed files with 103 additions and 13 deletions
|
@ -5,10 +5,25 @@ os.execute("cargo build --release")
|
|||
os.execute("cp target/release/pack .")
|
||||
print("Done!\n\n")
|
||||
|
||||
print("Setup environment? (requires root) [Y/n]:")
|
||||
stdo = io.open("/dev/stdout", "w")
|
||||
stdo:write("Setup environment? (requires root) [Y/n]: ")
|
||||
io.close(stdo)
|
||||
input = io.read()
|
||||
if input == "y" then
|
||||
if input ~= "n" then
|
||||
os.execute("scripts/setup.sh")
|
||||
else
|
||||
print("Goodbye!\n")
|
||||
end
|
||||
|
||||
print()
|
||||
|
||||
print("Add /usr/pack/bin/ to path? [Y/n]:")
|
||||
input = io.read()
|
||||
if input ~= "n" then
|
||||
print("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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue