📝 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): def goodbye(instance):
choice = prompt(instance, "Really quit lambda? (y/n): ", 11) try:
if choice and choice[0] == "y": # Confirm before exiting
curses.endwin() choice = prompt(instance, "Really quit lambda? (y/n): ", 11)
sys.exit()
else: # If the user confirms, exit
clear(instance, instance.height - 1, 0) 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 #!/bin/sh
# Copy lambda to ~/.local/share # Copy lambda to ~/.local/share
rm -rf ~/.local/share/lambda mkdir -p ~/.local/share/lambda
ln -sf "$(pwd)" ~/.local/share/lambda cp -rf . ~/.local/share/lambda
# Copy lambda to ~/.local/share
#mkdir -p ~/.local/share/lambda
#cp -rf . ~/.local/share/lambda
# Copy lambda launcher # Copy lambda launcher
chmod +x ./lambda chmod +x ./lambda

View File

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