📝 Update installer again
This commit is contained in:
parent
154a020520
commit
f312672152
@ -186,10 +186,22 @@ def fatal_error(exception: Exception):
|
|||||||
|
|
||||||
|
|
||||||
def goodbye(instance):
|
def goodbye(instance):
|
||||||
|
try:
|
||||||
|
# Confirm before exiting
|
||||||
choice = prompt(instance, "Really quit lambda? (y/n): ", 11)
|
choice = prompt(instance, "Really quit lambda? (y/n): ", 11)
|
||||||
if choice and choice[0] == "y":
|
|
||||||
curses.endwin()
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
|
# If the user confirms, exit
|
||||||
|
if choice and choice[0] == "y":
|
||||||
|
gracefully_exit()
|
||||||
|
|
||||||
|
# Clear the prompt if the user cancels
|
||||||
else:
|
else:
|
||||||
clear(instance, instance.height - 1, 0)
|
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)
|
||||||
|
@ -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
|
||||||
|
6
main.py
6
main.py
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user