📝 Update installer again

This commit is contained in:
Maddie H 2022-04-17 15:52:15 +01:00
parent 154a020520
commit f312672152
3 changed files with 23 additions and 15 deletions

View File

@ -186,10 +186,22 @@ def fatal_error(exception: Exception):
def goodbye(instance):
choice = prompt(instance, "Really quit lambda? (y/n): ", 11)
if choice and choice[0] == "y":
curses.endwin()
sys.exit()
try:
# Confirm before exiting
choice = prompt(instance, "Really quit lambda? (y/n): ", 11)
else:
clear(instance, instance.height - 1, 0)
# If the user confirms, exit
if choice and choice[0] == "y":
gracefully_exit()
# Clear the prompt if the user cancels
else:
clear(instance, instance.height - 1, 0)
except KeyboardInterrupt:
# If the user presses Ctrl+C, just exit
gracefully_exit()
except Exception as exception:
# If there is an error, print the error message and traceback
fatal_error(exception)

View File

@ -1,12 +1,8 @@
#!/bin/sh
# Copy lambda to ~/.local/share
rm -rf ~/.local/share/lambda
ln -sf "$(pwd)" ~/.local/share/lambda
# Copy lambda to ~/.local/share
#mkdir -p ~/.local/share/lambda
#cp -rf . ~/.local/share/lambda
mkdir -p ~/.local/share/lambda
cp -rf . ~/.local/share/lambda
# Copy lambda launcher
chmod +x ./lambda

View File

@ -99,15 +99,15 @@ def main():
config = utils.load_config()
# Load lambda with the buffer object
screen = Lambda(buffer, config)
instance = Lambda(buffer, config)
# Start the screen, this will loop until exit
try:
screen.start()
instance.start()
# KeyboardInterrupt is thrown when <C-c> is pressed (exit)
except KeyboardInterrupt:
utils.gracefully_exit()
utils.goodbye(instance)
# Excepts *any* errors that occur
except Exception as exception: